ActionBarの背景色と文字色を変更する

res/values/styles.xmlで定義

    <style name="AppBaseTheme" parent="android:Theme.Light">
    </style>
    <style name="AppTheme" parent="AppBaseTheme">
        <item name="android:actionBarStyle">@style/my_actionbar_style</item>
        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    </style>
    <style name="my_actionbar_style" parent="@android:style/Widget.Holo.Light.ActionBar">
        <item name="android:background">#1e90ff</item><!-- 背景色 -->
        <item name="android:titleTextStyle">@style/my_actionbar_titletextstyle</item>
    </style>
    <style name="my_actionbar_titletextstyle" parent="android:style/TextAppearance.Holo.Widget.ActionBar.Title">
        <item name="android:textColor">#ffffff</item><!-- 文字色 -->
    </style>

 

参考

 

カテゴリー: Android, View タグ: パーマリンク

コメントを残す

メールアドレスが公開されることはありません。 ※ が付いている欄は必須項目です