如何隐藏智能手机顶部上方的电池,连接,Wi-Fi等(状态栏)?我删除了标题栏
<application
android:theme="@android:style/Theme.NoTitleBar" >
答案 0 :(得分:2)
答案 1 :(得分:1)
<强> style.xml:强>
<style name="AppTheme.NoTitle" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<强>的AndroidManifest.xml:强>
<activity
android:name=".FullScreenActivity"
android:theme="@style/AppTheme.NoTitle"
>
</activity>
答案 2 :(得分:0)
在设置内容视图之前,在onCreate
方法中添加以下两行:
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
答案 3 :(得分:0)
如果您想在Android 4.0及更高版本上隐藏状态栏,请执行此操作
View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
// Remember that you should never show the action bar if the
// status bar is hidden, so hide that too if necessary.
ActionBar actionBar = getActionBar();
actionBar.hide();
查看此链接以获取更多信息 https://developer.android.com/training/system-ui/status.html
答案 4 :(得分:0)
在onCreate()
中添加此行setContentView(R.layout.activity_view_hotel_image);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getSupportActionBar().hide();