2015-02-05 7 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는

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에 전화 마십시오 14로 설정? 내 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> 

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

menifestfile에 대한 구현 클릭 리스너에서 예, 당신은이 경우의 옵션 메뉴를 만들 필요가있다.

+0

예 내 매니페스트 응용 프로그램 테마에 설정되어 있지만 이상하게도 효과가없는 것 같습니다. –