编程检测Android设备中的软导航栏可用性? [英] Detect soft navigation bar availability in android device progmatically?

查看:65
本文介绍了编程检测Android设备中的软导航栏可用性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to determine soft navigation bar through the android program. I didn't find straight way to determine. Is there anyway to find the navigation bar availability.

软导航栏图像在这里.

推荐答案

以下方法对我有效,并在许多设备中进行了测试.

Following method worked for me and tested in many devices.

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

注意:已在真实设备中验证了此方法

Note: Verified this method in real device

这篇关于编程检测Android设备中的软导航栏可用性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆