0

我嘗試使用2個主題的一項活動,一個對話框,一個用於隱藏標題欄,在AndroidManifest:我想在android顯卡使用2個android主題?

<activity> 
    android:theme="@android:style/Theme.Dialog" 
    android:theme="@android:style/Theme.Black.NoTitleBar" 
    android:label="@string/app_name" > (it show X here!!) 
    <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.LAUNCHER" /> 
    </intent-filter> 
</activity> 

我只能用一次一個......

回答

0

你可以使用

requestWindowFeature(Window.FEATURE_NO_TITLE); 

Activity刪除ActionbBar。你應該在setContentView之前使用它。如果您使用requestWindowFeature刪除android:theme="@android:style/Theme.Black.NoTitleBar"

1

你可以嘗試這樣。在Styles.xml

<?xml version="1.0" encoding="utf-8"?> 

<style name="ExampleTheme" parent="Theme.Sherlock.Light.DarkActionBar"> 
     <!-- <item name="homeAsUpIndicator">@drawable/new_indicator</item> --> 
    <!-- <item name="android:homeAsUpIndicator">@drawable/new_indicator</item> --> 
</style> 

<style name="CustomTheme" parent="Theme.Sherlock.Light.DarkActionBar"> 
    <item name="homeAsUpIndicator">@drawable/new_indicator</item> 
     <!-- <item name="android:homeAsUpIndicator">@drawable/new_indicator</item> --> 
</style> 

在你menifeast.xml

<application 
    android:allowBackup="true" 
    android:icon="@drawable/app_icon" 
    android:label="@string/app_name" 
    android:theme="@style/ExampleTheme" > 
    <activity 
     android:name="com.ebizzinfotech.regularcoupon.SplashActivity" 
     android:theme="@style/Theme.Sherlock.Light.DarkActionBar" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
<activity android:name="com.ebizzinfotech.regularcoupon.MainActivity" 
     android:screenOrientation="portrait" 
     android:theme="@style/CustomTheme"> 
</activity>