Home  >  Q&A  >  body text

android - 安卓虚拟导航栏如何更改外观(颜色是黑的,很难看)

虚拟导航栏只有黑色,能不能调成半透明或是多加一个隐藏摁键?

大家讲道理大家讲道理2729 days ago765

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 16:20:00

    Transparency is achievable,

    Window window = getWindow();
        // 状态栏透明
        window.setFlags(
            WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
            WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        // 虚拟导航栏透明
        window.setFlags(
            WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
            WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
    

    You need to check the version, which is only available after 4.4.
    The corresponding activity layout needs to add the following attribute to the layout root node.

    android:fitsSystemWindows="true"

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 16:20:00

    getWindow().setNavigationBarColor() can set the color of the bottom navigation bar
    getWindow().setStatusBarColor() can set the color of the top status bar

    If you want the layout to extend to the navigation bar or status bar, refer to the 1L settings

    The bottom navigation bar is designed to add buttons...

    reply
    0
  • Cancelreply