We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remi Note 5 MIUI 12.0.3 Android 9.0
在无导航栏的情况下,ImmersionBar.hasNavigationBar(context)返回true
The text was updated successfully, but these errors were encountered:
有什么解决方法么?
Sorry, something went wrong.
时间有点久了,我当时写的代码找不到了。当时用WindowInsets解决的这个问题,去网络搜索了下整理出了下面的代码,代码未经测试仅供参考
public boolean hasNavigationBar(Activity activity) { View decorView = activity.getWindow().getDecorView(); //android 5.0以下ViewCompat.getRootWindowInsets会反馈null WindowInsetsCompat windowInsets = ViewCompat.getRootWindowInsets(decorView); if (null != windowInsets) { int top = windowInsets.getInsets(WindowInsetsCompat.Type.navigationBars()).top; int bottom = windowInsets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom; int height = Math.abs(bottom - top); return height > 0; } return false; }
No branches or pull requests
Remi Note 5
MIUI 12.0.3
Android 9.0
在无导航栏的情况下,ImmersionBar.hasNavigationBar(context)返回true
The text was updated successfully, but these errors were encountered: