gpt4 book ai didi

android - 如何设置标题栏的文字颜色?

转载 作者:太空宇宙 更新时间:2023-11-03 12:08:46 24 4
gpt4 key购买 nike

我用这个作为主题。

<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>

有了这个背景图像,但文本颜色没有改变。

在 list 中我是这样使用的。

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

最佳答案

这对我有用。

<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>

关于android - 如何设置标题栏的文字颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18525793/

24 4 0