跳至主要内容

博文

目前显示的是标签为“navigation”的博文

android immerge navigation bar & status bar

https://developer.android.com/training/system-ui/immersive.html http://niorgai.github.io/2016/03/20/Android-transulcent-status-bar/ if (Build.VERSION. SDK_INT >= Build.VERSION_CODES. LOLLIPOP ) { float [] floats= new float [ 3 ] ; getWindow().setNavigationBarColor(Color. HSVToColor ( 0 , floats)) ; getWindow().setStatusBarColor(Color. HSVToColor ( 0 , floats)) ; this .findViewById(Window. ID_ANDROID_CONTENT ).setSystemUiVisibility( View . SYSTEM_UI_FLAG_LAYOUT_STABLE | View . SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View . SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION ) ; }

Android navigation bar color setup

It can be done using <item name="android:navigationBarColor">@color/theme_color</item> or window.setNavigationBarColor(@ColorInt int color) http://developer.android.com/reference/android/view/Window.html#setNavigationBarColor(int) Note that the method was introduced in Android Lollipop and won't work on API version < 21. The second method (works on KitKat) is to set windowTranslucentNavigation to true in the manifest and place a colored view beneath the navigation bar.