简体   繁体   中英

why can't I put any components on the navigation bar or on the status bar

all details I wanted to make a fully transparent navigation bar and status bar, and found this article https://medium.com/androiddevelopers/gesture-navigation-going-edge-to-edge-812f62e4e83e

but i ran into a problem i can't display anything next to nav bar or status bar it looks like this: enter image description here

xml code:

`

<item name="android:enforceNavigationBarContrast">false</item>
<item name="android:enforceStatusBarContrast">false</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>

` java code:

`

Window w = getWindow();
WindowCompat.setDecorFitsSystemWindows(w, false);

`

What is the problem? I do not understand:(

googled and wrote a question on stack overflow

everything is fine with the code, check if you don't have

android:fitsSystemWindows = true

in your layout

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM