简体   繁体   中英

Android : On Notification bar dismiss, view gets resized under status bar. How to disable the resizing?

Here's my activity scenario. 在此处输入图片说明

1 - shows my activity layout, with image stretch across the view

2,3 - On drop down of the notification bar, the imageview gets resized to the status bar size

4,5 - On dismissing the notification bar (dragging up), the imageview has a white gap on the top (height equals status bar height), and then suddenly jumps to full screen.

The activity has flags SYSTEM_UI_FLAG_HIDE_NAVIGATION or SYSTEM_UI_FLAG_FULLSCREEN or SYSTEM_UI_FLAG_IMMERSIVE_STICKY set.

Tried many settings and combinations, but no solutions has been found yet.

Any solutions for removing this resizing of the imageview ?

Finally playing with many options, I finally found a workaround.

in onWindowFocusChanged added the flags to the window, FLAG_FULLSCREEN and clear Flag FLAG_FORCE_NOT_FULLSCREEN .

this avoids the activity being resized when notification bar gets dragged down.

Any better solutions are welcome.

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