gpt4 book ai didi

Android Light AppTheme with Dark ActionBar (AppCompat)

转载 作者:太空狗 更新时间:2023-10-29 14:51:01 24 4
gpt4 key购买 nike

我有应用程序主题 Theme.AppCompat.Light.NoActionBar 为我的应用程序提供了浅色主题,因此 Dialogs 等上的文本是深色的。我还希望我的 Toolbar 有深色背景和浅色前景,所以我将这些写到 Toolbar:

app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"

问题:这使得 Toolbar 在 Lollipop 上变暗,文本和后退图标变白,但在 KitKat 上不起作用:

Lollipop :

enter image description here


奇巧: enter image description here

问题如何使用我当前的主题 Theme.AppCompat.Light.NoActionBar 在 KitKat 上制作带有浅色内容的深色工具栏?

最佳答案

试试这个:

<style name="MyToolbarStyle" parent="Theme.AppCompat.Light">
<!-- Used to for the title of the Toolbar -->
<item name="android:textColorPrimary">#fff</item>
<!-- Used to for the title of the Toolbar when parent is Theme.AppCompat.Light -->
<item name="android:textColorPrimaryInverse">#fff</item>
<!-- Used to color the text of the action menu icons -->
<item name="android:textColorSecondary">#fff</item>
<!-- Used to color the overflow menu icon -->
<item name="actionMenuTextColor">#fff</item>
<!-- Color of the Toolbar -->
<item name="android:background">#455a64</item>
</style>

查看这篇文章:

Android Theme.AppCompat.Light with Dark Toolbar (for light text)

关于Android Light AppTheme with Dark ActionBar (AppCompat),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35338757/

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