简体   繁体   中英

Android can't go fullscreen with immersive mode

So I try to implement immersive sticky fullscreen mode in my app by the standard approach described here: http://developer.android.com/training/system-ui/immersive.html

That will hide navigation and status bar, but draws black where the status bar was and white at the position of the navigation bar. It seems like it does not resize my layout.

Any idea how to fix that? As I said I'm using the code provided by Android Developers. There should not be any code from my app that alters that. It's used within my main activity.

Thanks in advance.

Nevermind, I found it. For anyone with the same problem: When starting a project Android Studio adds the following line to your main_activity layout file:

android:fitsSystemWindows="true"

Simply remove it and there will be no problem with fullscreen mode.

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