【发布时间】:2019-05-02 14:17:37
【问题描述】:
我的应用如何确定使用 Android 9 (P) 的用户使用的是经典导航栏还是类似 iOS 的新手势?
【问题讨论】:
标签: android gesture navigationbar
我的应用如何确定使用 Android 9 (P) 的用户使用的是经典导航栏还是类似 iOS 的新手势?
【问题讨论】:
标签: android gesture navigationbar
view.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() {
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
Log.d(TAG, "onApplyWindowInsets: B"+ insets.getSystemWindowInsetBottom());
return insets.consumeSystemWindowInsets();
}
});
我在片段的 onViewCreated 方法中声明了它。当导航模式改变时,insets.getSystemWindowInsetBottom() 返回不同的值。
参考:https://developer.android.com/preview/features/gesturalnav
【讨论】: