Window.SetNavigationBarColor(Color) Method

Definition

Sets the color of the navigation bar to .

[Android.Runtime.Register("setNavigationBarColor", "(I)V", "GetSetNavigationBarColor_IHandler")]
public abstract void SetNavigationBarColor (Android.Graphics.Color color);
[<Android.Runtime.Register("setNavigationBarColor", "(I)V", "GetSetNavigationBarColor_IHandler")>]
abstract member SetNavigationBarColor : Android.Graphics.Color -> unit

Parameters

color
Color
Attributes

Remarks

Sets the color of the navigation bar to .

For this to take effect, the window must be drawing the system bar backgrounds with android.view.WindowManager.LayoutParams#FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS and android.view.WindowManager.LayoutParams#FLAG_TRANSLUCENT_NAVIGATION must not be set.

If is not opaque, consider setting android.view.View#SYSTEM_UI_FLAG_LAYOUT_STABLE and android.view.View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION.

The transitionName for the view background will be "android:navigation:background".

If the color is transparent and the window enforces the navigation bar contrast, the system will determine whether a scrim is necessary and draw one on behalf of the app to ensure that the navigation bar has enough contrast with the contents of this app, and set an appropriate effective bar background accordingly.

If the app targets android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM VANILLA_ICE_CREAM or above, the color will be transparent and cannot be changed.

This member is deprecated. Draw proper background behind WindowInsets.Type#navigationBars() or WindowInsets.Type#tappableElement() instead.

Java documentation for android.view.Window.setNavigationBarColor(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to