gpt4 book ai didi

android - 如何在 Pre-Lollipop 版本中更改工具栏文本颜色

转载 作者:行者123 更新时间:2023-11-29 20:48:29 25 4
gpt4 key购买 nike

在 Lollipop 版本中,我的工具栏文本颜色是白色,但是当我在 pre-lollipop 设备上运行我的应用程序时显示黑色而不是白色 ...

styles.xml:-

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">

<item name="colorPrimary">@color/ColorPrimary</item>
<item name="colorPrimaryDark">@color/ColorPrimaryDark</item>

</style>

工具栏:

<android.support.v7.widget.Toolbar
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:background="@color/ColorPrimary"
android:elevation="2dp"
android:theme="@style/Base.ThemeOverlay.AppCompat.Dark"
xmlns:android="http://schemas.android.com/apk/res/android" />

最佳答案

使用以下内容

toolbarView.setTitleTextColor(toolbarTextColor);

关于android - 如何在 Pre-Lollipop 版本中更改工具栏文本颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29792812/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com