当前位置: 移动技术网 > 移动技术>移动开发>Android > Android实现隐藏状态栏和标题栏

Android实现隐藏状态栏和标题栏

2019年07月24日  | 移动技术网移动技术  | 我要评论

隐藏标题栏需要使用预定义样式: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);
 
}

以上所述就是本文的全部内容了,希望大家能够喜欢。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网