gpt4 book ai didi

android - 如何更改android中状态栏的颜色?

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

这是我的风格

 <style name="NoActionbar" parent="android:style/Theme.NoTitleBar">

<item name="android:statusBarColor">#1c465d</item>

</style

>

我想通过删除操作栏来更改启动画面但我意识到默认状态栏颜色是黑色,我无法将状态栏的颜色更改为绿色

为什么是这个节目?

我该怎么做?

最佳答案

如上所述,将样式中的 colorPrimaryDark 属性设置为您喜欢的任何值。

<resources>
<!-- inherit from the material theme -->
<style name="AppTheme" parent="android:Theme.Material">
<!-- Main theme colors -->
<!-- your app branding color for the app bar -->
<item name="android:colorPrimary">@color/primary</item>
<!-- darker variant for the status bar and contextual app bars -->
<item name="android:colorPrimaryDark">@color/primary_dark</item>
<!-- theme UI controls like checkboxes and text fields -->
<item name="android:colorAccent">@color/accent</item>
</style>
</resources>

http://developer.android.com/training/material/theme.html

要正确地做到这一点,您应该在 color.xml 中声明您的颜色值,然后从样式中引用它。

关于android - 如何更改android中状态栏的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36098416/

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