Android实现隐藏状态栏和标题栏
程序员文章站
2023-08-29 19:43:09
隐藏标题栏需要使用预定义样式:android:theme=”@android:style/theme.notitlebar”.
隐藏状态栏:android:theme=...
隐藏标题栏需要使用预定义样式:android:theme=”@android:style/theme.notitlebar”.
隐藏状态栏:android:theme=”@android:style/theme.notitlebar.fullscreen”.
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="de.vogella.android.temperature" android:versioncode="1" android:versionname="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".convert" android:label="@string/app_name" android:theme="@android:style/theme.notitlebar.fullscreen" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application> <uses-sdk android:minsdkversion="9" /> </manifest>
@override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // hide titlebar of application // must be before setting the layout requestwindowfeature(window.feature_no_title); // hide statusbar of android // could also be done later getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); setcontentview(r.layout.main); text = (edittext) findviewbyid(r.id.edittext01); }
以上所述就是本文的全部内容了,希望大家能够喜欢。
上一篇: 老百姓对李自成的期望很高,但为何当了皇帝的他就堕落了?
下一篇: android 设置全屏的两种方法