![](/img/trans.png)
[英]How to set selectedItem in bottomNavigationView to nothing?
[英]How to set color for BottomNavigationView?
我需要使用 android:background="?android:attr/windowBackground",但白天和夜晚的版本具有不同的值。 我怎样才能做到这一点? 是否可以使用 colors.xml 和 themes.xml 来做到这一点
首先在合适的资源目录下定义night-value文件夹和night theme 。
res/values-night/themes.xml
像这样覆盖android:windowBackground
:
<style name="LaunchTheme" parent="AppTheme">
<item name="android:windowBackground">@drawable/screen_night</item>
</style>
然后你可以像这样自定义你的屏幕:
res/drawable/screen_night.xml
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<color android:color="@color/white"/>
</item>
<item>
<bitmap
android:gravity="center"
android:src="@drawable/any_logo"
android:tileMode="disabled"/>
</item>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.