大家好,我想知道是否可以更改状态栏颜色或使其完全透明。
虽然我尝试了很多方法,但我无法获得完全透明的状态栏,这是我的代码:
v21/style.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>
</resources>
以及style.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
在我使用之后,我的屏幕显示为...
![current login screen](https://istack.dev59.com/K2BUS.webp)
![desired login screen](https://istack.dev59.com/iNe32.webp)
yourView
在这里指的是什么?RootView 吗? - fahmy