隐藏小屏幕的操作栏

Hide action bar for small screen

我正在开发 android aap,我想隐藏小屏幕 (240x320) 的操作栏,但不适用于普通屏幕和大屏幕。是的话可以隐藏吗?

那么你需要先获取维度..

获取维度的方法如下:

Display display = getWindowManager().getDefaultDisplay(); 
int width = display.getWidth();
int height = display.getHeight();

see answers here on how to get the screen dimension

隐藏操作栏的方法如下

    getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
    getActionBar().hide();

v7新增支持actionbar用户,代码为:

getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
getSupportActionBar().hide();

see answers here on how to hide action bar

在 Android 4.0 和更低版本

上隐藏状态栏
<application
...
android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen" >
...

或者 必须在设置布局之前。

requestWindowFeature(Window.FEATURE_NO_TITLE);

有关更多信息,您可以访问 Here .