1. 定义样式(例如在styles.xml里,定义一个CustomActionBarTheme的式样):
<resources> <style name="CustomActionBarTheme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionBarStyle">@style/MyActionBar</item> </style> <style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar"> <item name="android:background">#FFFFFF</item> </style> </resources>
2. 在AndroidManifest.xml里对应的Activity声明里调用这个式样:
<activity android:name="com.xxx.activity.LocationSelectActivity" android:label="" android:screenOrientation="portrait" android:theme="@style/CustomActionBarTheme"> <meta-data android:name="android.support.PARENT_ACTIVITY" android:value="com.xxx.activity.MainActivity" /> </activity>