我需要從整個應用程序中刪除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
簡單明瞭!這種方式在代碼中沒有笨拙的東西......這應該成爲公認的答案。 – GeertVc