答案 0 :(得分:3)
内部styles.xml
:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
...
<item name="android:navigationBarColor">@android:color/black</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
在活动的onCreate()
中:
override fun onCreate(savedInstanceState: Bundle?) {
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
会导致这个: