Created
February 10, 2014 03:12
-
-
Save AvatarQing/8909756 to your computer and use it in GitHub Desktop.
supprot v7 AppCompat 自定义ActionBar样式
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources xmlns:android="http://schemas.android.com/apk/res/android"> | |
<!-- Application theme. --> | |
<style name="AppThemeForMobileSafe" parent="AppBaseThemeForMobileSafe"> | |
<item name="android:actionBarStyle">@style/MobilseSafeActionBarStyle</item> | |
</style> | |
<style name="MobilseSafeActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid"> | |
<!-- 自定义ActionBar的背景色 --> | |
<item name="android:background">@drawable/action_bar_bg</item> | |
<!-- ActionBar标题文字样式 --> | |
<item name="android:titleTextStyle">@style/MobileSafeActionBarTitleStyle</item> | |
<!-- ActionBar副标题文字样式 --> | |
<item name="android:subtitleTextStyle">@style/MobileSafeActionBarSubtitleStyle</item> | |
</style> | |
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources xmlns:android="http://schemas.android.com/apk/res/android"> | |
<!-- Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. --> | |
<style name="AppBaseThemeForMobileSafe" parent="@style/Theme.AppCompat.Light"></style> | |
<!-- Application theme. --> | |
<style name="AppThemeForMobileSafe" parent="AppBaseThemeForMobileSafe"> | |
<item name="actionBarStyle">@style/MobilseSafeActionBarStyle</item> | |
</style> | |
<style name="MobilseSafeActionBarStyle" parent="@style/Widget.AppCompat.Light.ActionBar"> | |
<!-- 自定义ActionBar的背景色 --> | |
<item name="background">@drawable/action_bar_bg</item> | |
<!-- ActionBar标题文字样式 --> | |
<item name="titleTextStyle">@style/MobileSafeActionBarTitleStyle</item> | |
<!-- ActionBar副标题文字样式 --> | |
<item name="subtitleTextStyle">@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle</item> | |
</style> | |
<!-- 自定义的ActionBar标题文字样式 --> | |
<style name="MobileSafeActionBarTitleStyle" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"> | |
<item name="android:textColor">@color/actionbar_main_title</item> | |
</style> | |
<!-- 自定义的ActionBar副标题文字样式 --> | |
<style name="MobileSafeActionBarSubtitleStyle" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle"> | |
<item name="android:textColor">@color/actionbar_main_subtitle</item> | |
</style> | |
</resources> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment