標籤:
想要全部視窗全屏無標題,修改
res\values\styles.xml 可設定主題和樣式
<resources> <!-- Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. --> <style name="AppBaseTheme" parent="android:Theme.Light"> <!-- Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. --> </style> <!-- Application theme. --> <style name="AppTheme" parent="AppBaseTheme"> <!-- 設定無標題--> <item name="android:windowNoTitle">true</item> <!-- 設定全屏--> <item name="android:windowFullscreen">true</item> <!-- All customizations that are NOT specific to a particular API-level can go here. --> </style></resources>
如果要單個視窗設定用如下2個方法
1. 修改AndroidManifest.xml
<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>
即加上 android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
2. 在代碼中設定
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);this.requestWindowFeature(Window.FEATURE_NO_TITLE);
Android TV 全屏無標題