有關Android去標題欄相關的知識

2021-08-03 10:17:27 字數 525 閱讀 8969

情況一:

如果使用**方法,程式會繼續執行,不會報錯,但標題欄不會去除。

在oncreat方法中新增的**如下:

requestwindowfeature(window.feature_no_title);

記得這個**要新增在setcontentview( )方法之前

如果是用在manifest中設定theme的方法(在manifest中設定的主題是:

android

:theme=

"@android:style/theme.notitlebar.fullscreen"

),程式編譯通過,執行會報錯,提示為

很明顯,提示讓必須用的主題是 

android

:theme=」

情況二:

如果activity繼承的是其他activity的子類,那麼使用上面介紹的兩種方法(**方法,manifest中設定主題的方法),都可以取掉標題欄,達到全屏的目的。

歡迎補充說明,支援不足

balanceli

Android共用標題欄

首先建立乙個標題的布局檔案 然後建立這個布局檔案對應的class,這個class繼承linearlayout類,並且實現view.onclicklistener package com.example.administrator.uicustomview import android.content...

android去除標題欄

這是常用的幾種辦法 方法1 直接在activity的oncreate 方法中,requestwindowfeature window.feature no title 注意這句 要寫在,設定布局之前,不過這樣有個缺點只是在單個頁面的!方法2 在清單檔案中配置一下,將它預設的主題改為 android ...

Android去除標題欄

name concealtitle name android windownotitle true item style resources 再從menifest中引用 android theme style concealtitle android系統自帶樣式 android theme andr...