3

これをテーマに使っています。

<style name="ThemeSelector" parent="android:Theme.Light">
    <item name="android:windowTitleBackgroundStyle">@style/WindowTitleBackground</item>
    <item name="android:textAppearance">@style/TitleTextColor</item>
</style>

<style name="WindowTitleBackground">
    <item name="android:background">@drawable/waterblue</item>        
</style>

<style name="TitleTextColor">
    <item name="android:textColor">@color/white</item>
</style>

この背景画像は割り当てられていますが、テキストの色は変更されていません。

マニフェストでは、このように使用しています。

<application
    android:name="com.example"
    android:allowBackup="true"
    android:icon="@drawable/logo"
    android:label="@string/app_name"
    android:theme="@style/ThemeSelector">
4

6 に答える 6

6

これは私のために働いています。

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

<style name="ThemeSelector" parent="@android:style/Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/myTheme.ActionBar</item>        
</style>

<style name="myTheme.ActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
    <item name="android:background">@drawable/lblue</item>
    <item name="android:titleTextStyle">@style/myTheme.ActionBar.Text</item>
    <item name="android:height">@dimen/app_head_height</item>
</style>

<style name="myTheme.ActionBar.Text" parent="@android:style/TextAppearance">
    <item name="android:textColor">@color/white</item>
    <item name="android:textSize">@dimen/app_head</item>
</style>

于 2013-09-16T12:00:13.630 に答える
1

style.xmlAPI レベル 23 以上の場合は、次の行を追加します。

<item name="android:titleTextColor">@color/black</item>
于 2018-06-28T03:42:52.597 に答える
0

属性名はandroid:textAppearanceではなくandroid :titleTextStyle になると思います

于 2013-08-30T05:53:51.180 に答える
0

Yas Bro あなたはこれを行うことができます...

独自のカスタム タイトルバーを作成したとしても ...

このリンクを通過するだけです

アクションバーのテキストを変更する方法

これはstackoverflowからのものです。

于 2013-08-30T05:58:03.767 に答える