2015-02-05 4 views
0

Как стиль меню переполнения Android ActionBar (цвет фона, цвет текста, пользовательские чертежи и т. Д.)?поддержка меню меню панели управления

Я пытался сделать это со следующими стилями, но ничего, похоже, не имеет никакого эффекта. Любая помощь будет принята с благодарностью.

<resources> 
     <!-- Base application theme. --> 
     <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 
      <!-- Customize your theme here. --> 
      <item name="android:actionBarWidgetTheme">@style/MyActionBar</item> 
      <item name="android:actionBarStyle">@style/MyActionBar</item> 
     </style> 

     <style name="MyActionBar" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse"> 
      <item name="android:textColor">@android:color/holo_blue_light</item> 
      <item name="android:actionBarItemBackground">@android:color/holo_green_light</item> 
      <item name="android:actionMenuTextColor">@android:color/holo_green_dark</item> 
     </style> 
    </resources> 

TIA!

BTW minSdk установлен в 14

AndroidManifest является

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.example.app1.app1"> 

    <application android:allowBackup="true" 
     android:label="@string/app_name" 
     android:icon="@drawable/ic_launcher" 
     android:theme="@style/AppTheme"> 

     <activity android:name=".MainActivity"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 

    </application> 

</manifest> 

ответ

0

Вы называете его AndroidManifest.xml файл? Пример в моем style.xml

<resources xmlns:android="http://schemas.android.com/apk/res/android"> 

<!-- the theme applied to the application or activity --> 
<style name="CustomActionBarTheme" parent="@android:style/Theme.Holo.Light.DarkActionBar"> 
    <item name="android:actionBarStyle">@style/MyActionBar</item> 
</style> 

<!-- ActionBar styles --> 
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse"> 
    <item name="android:background">@color/green_dark</item> 
    <item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item> 
</style> 

<style name="MyTheme.ActionBar.TitleTextStyle" parent="@android:style/TextAppearance"> 
    <item name="android:textColor">@color/white</item> 
    <item name="android:textStyle">bold</item> 
</style> 

и menifestfile

<application 
    android:allowBackup="true" 
    android:icon="@drawable/ic_launcher1" 
    android:label="@string/app_name" 
    android:theme="@style/CustomActionBarTheme" > 
    <activity..... 

Для реализации щелчка слушателем, необходимо создать меню опций для этого случая.

+0

Да, он установлен в моей манифестной теме приложения, но, похоже, не имеет никакого эффекта. –

Смежные вопросы