如何将导航栏更改为三点模式?

时间:2015-07-11 16:25:28

标签: android

我想将导航栏设置为三点外观,例如: enter image description here

Android Developers网站显示了如何完全删除导航栏(全屏模式),但未显示如何启用此模式。

我该怎么做?

1 个答案:

答案 0 :(得分:3)

请参阅此document

基本上,在onCreate

之前的setContentView中调用此方法
// This example uses decor view, but you can use any visible view.
View decorView = getActivity().getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_LOW_PROFILE;
decorView.setSystemUiVisibility(uiOptions);

当您需要以编程方式显示条形图时,请清除以下标记:

View decorView = getActivity().getWindow().getDecorView();
// Calling setSystemUiVisibility() with a value of 0 clears
// all flags.
decorView.setSystemUiVisibility(0);