1

ActionBarアプリケーション全体からを削除する必要があるためTheme.NoTitleBar、マニフェストのコードに追加しました。

以下は私のマニフェストです

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.beleeta.bileetacrm"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="17" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar" >
        <activity
            android:name="com.beleeta.bileetacrm.Home"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

しかし、これではアプリケーション全体の背景が黒く見えてしまいます! この変更を行う前は、アプリケーションは白で、以下はコードでした

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.beleeta.bileetacrm"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="17" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.beleeta.bileetacrm.Home"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

なぜこうなった?どうすればこれを取り除くことができますか? これらのアクション バーを扱うのはこれが初めてです。

私の最小SDKは11です。

4

2 に答える 2

4

デフォルトTheme(したがってTheme.NoTitleBar) はダーク テーマですTheme.Light.NoTitleBar。ライト (つまり、バックグラウンド) テーマに使用できます。

于 2013-10-31T05:27:54.947 に答える
1

android:theme="@android:style/Theme.NoTitleBar"マニフェスト ファイルから削除します。これを追加します

this.requestWindowFeature(Window.FEATURE_NO_TITLE); 

setcontentview を行う前にすべてのクラスに。

于 2013-10-31T05:28:08.103 に答える