【发布时间】:2017-08-04 11:11:15
【问题描述】:
【问题讨论】:
【问题讨论】:
为您的主题设置样式,如下代码所示
<resources>
<style name="Theme" parent="android:Theme.Material.Wallpaper.NoTitleBar">
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>
</resources>
【讨论】:
为了在应用程序内部执行此操作,我将其用于 styles.xml
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:fitsSystemWindows">true</item>
【讨论】:
设置 navigationBarColor 改变颜色。
Check here 查看需要提及的标志。如果颜色不透明,则有不同的标志集,否则有另一组标志。
void setNavigationBarColor (int color) 块引用
将导航栏的颜色设置为 。为使其生效, 窗口必须绘制系统栏背景 FLAG_DRAW_SYSTEM_BAR_BACKGROUNDS 和 FLAG_TRANSLUCENT_NAVIGATION 必须 不设置。如果不是不透明的,考虑设置 SYSTEM_UI_FLAG_LAYOUT_STABLE 和 SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION。
视图背景的 transitionName 将是 “机器人:导航:背景”。
【讨论】: