Pixel 5 沉浸式的兼容有问题


如图,Demo跑起来之后顶部的bar适配有问题。 我们的项目用的ViewPager2+Fragment的方式写的主页,顶部的沉浸式在 Pixel 5 上适配也有问题。 通过各种api获取的高度也不准。 换成在布局里写 fitsSystemWindows=true 则会遇到第一tab有沉浸式,后面几个tab不会触发fitsSystemWindows的问题。
很奇怪的是,我们有3部同一型号的 Pixel 5 手机,最新版系统的两个都有这个问题,剩下一台root后的手机没这个问题。
use ImmersionBar.with(this).fitsSystemWindows(true) .
Mi 10 Android 12 work fine : "notchHeight":90 , "statusBarHeight":90
pixel 5 Android12 has issue : "notchHeight":136, "statusBarHeight":77
我也遇到这个问题了,机型是pixel 4a,系统是android12,好像只有开孔屏会出现

use ImmersionBar.with(this).fitsSystemWindows(true) . Mi 10 Android 12 work fine : "notchHeight":90 , "statusBarHeight":90 pixel 5 Android12 has issue : "notchHeight":136, "statusBarHeight":77
You can try my solution : https://github.com/luffyjet/ImmersionBar I also published it to JITPACK : https://jitpack.io/#luffyjet/ImmersionBar
https://www.androidpolice.com/stable-android-12l-exhibits-a-status-bar-glitch-that-wasnt-caught-in-months-of-beta-testing/
some android users hava reported this problem,on androidpolice website
刚才更新android12最新补丁,google好像从系统层面修复了这个问题
真的吗,晚点更新下系统试试
请问解决了吗这个问题,我是用的模拟器还是存在这个问题
请问解决了吗这个问题,我是用的模拟器还是存在这个问题
没有哦。 如果是Activity,要手动在XML里设置fitSystomWindow;Fragment比较难搞了。 暂时没有完美的解决方案。