国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > Android > 正文

Android 開發(fā)隱藏標題欄的方法總結

2019-10-23 18:30:08
字體:
來源:轉載
供稿:網(wǎng)友

android 開發(fā)隱藏標題欄的方法總結

1. 推薦!(因為現(xiàn)在工程都默認的為AppTheme)

在value/styles.xml里面添加自定義屬性

<resources xmlns:android="http://schemas.android.com/apk/res/android">  <!-- Application theme. -->  <style name="AppTheme" parent="AppBaseTheme">    <item name="android:windowNoTitle">true</item></resources>

 2.

public class MainActivity extends Activity{  @Override  protected void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    // 隱藏標題欄    requestWindowFeature(Window.FEATURE_NO_TITLE);    // 隱藏狀態(tài)欄    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,    WindowManager.LayoutParams.FLAG_FULLSCREEN);    //一定要放在setContentView()之前!    setContentView(R.layout.activity_main);  }}

3.

<!-- 同時隱藏狀態(tài)欄和標題欄 --><activity  android:name="com.ysj.demo.MainActivity"  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"  android:label="@string/app_name" >  <intent-filter>    <action android:name="android.intent.action.MAIN" />    <category android:name="android.intent.category.LAUNCHER" />  </intent-filter></activity> 

4.打開項目文件AndroidManifest.xml ,打開Application選擇TAB頁,在頁面下方的Application Nodes中點選擇相應的類,   配置右側的Theme屬性。

在彈出選擇框中點選"system Resources",選擇Theme.NoTitleBar項目,然后重新打開頁面就行了

感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!


注:相關教程知識閱讀請移步到Android開發(fā)頻道。
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 芒康县| 湟源县| 威远县| 潼关县| 镇江市| 雅江县| 荆门市| 鹤壁市| 文安县| 稷山县| 漯河市| 德阳市| 宣化县| 江门市| 清新县| 临颍县| 嵊州市| 岱山县| 淮安市| 苏尼特右旗| 桂林市| 汉川市| 尚志市| 稷山县| 博乐市| 禹州市| 通州区| 武陟县| 通渭县| 烟台市| 双江| 永胜县| 甘泉县| 当阳市| 五河县| 内乡县| 洪洞县| 利辛县| 疏勒县| 临高县| 海林市|