android - 如何以编程方式检测android中可用的底部软导航栏?

标签 android android-layout android-navigation

我正在尝试通过 android 程序确定软导航栏。我没有找到直接的方法来确定。无论如何找到导航栏的可用性。

软导航栏图像在这里。

enter image description here

最佳答案

以下方法对我有用,并在许多设备上进行了测试。

public boolean hasNavBar (Resources resources)
    {
        int id = resources.getIdentifier("config_showNavigationBar", "bool", "android");
        return id > 0 && resources.getBoolean(id);
    }

注意:在真机验证此方法

关于android - 如何以编程方式检测android中可用的底部软导航栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28983621/

相关文章:

android - 在哪里可以找到 Android 图标来指示点击列表行时还有更多内容?

android - 如何在菜单项上做点击事件?

android - 如何设置按钮的宽度和高度相同

android - 如何在一组特定 fragment 之间共享 ViewModel 范围,而不使用 NavGraphs 或将其范围限定到 Activity ?

android - Cloud Firestore 数据库结构

android - 如何在Flutter中做隐式 Intent ?

android - 使用 Xamarin 和 Azure 启用 Google Cloud Messaging API

android - ImageView 有过多的垂直填充

android - 防止在 BottomNavigationView 中快速单击

android - 阻止/禁用最近使用的应用程序按钮