Check if translucent navigation is available

前端 未结 1 824
我寻月下人不归
我寻月下人不归 2021-01-06 02:08

How can I check if translucent navigation is available ?

I am currently setting it to translucent with:

if (Build.VERSION.SDK_INT >= Build.VERSI         


        
相关标签:
1条回答
  • 2021-01-06 02:57

    On KitKat devices, translucent system bars can be disabled with a framework boolean configuration resource. You can inspect the value of that resource at runtime.

    int id = getResources().getIdentifier("config_enableTranslucentDecor", "bool", "android");
    if (id == 0) {
        // not on KitKat
    } else {
        boolean enabled = getResources().getBoolean(id);
        // enabled = are translucent bars supported on this device
    }
    
    0 讨论(0)
提交回复
热议问题