46 android android-manifest android-fullscreen
我想将我的应用程序设置为全屏视图.我有想法使用FullScreen
和在单个活动中设置它NoTitlebar
,但是我想在整个应用程序的Manifest XML文件中设置它而不是每个活动......这可能吗?
帮帮我......谢谢.
Mar*_*oek 110
要在全屏模式下设置应用程序或任何单个活动,请插入代码
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
Run Code Online (Sandbox Code Playgroud)
在AndroidManifest.xml中的应用程序或活动选项卡下.
val*_*cat 66
另一种方法:直接添加windowNoTitle
和windowFullscreen
属性到主题(你可以styles.xml
在res/values/
目录中找到文件):
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
Run Code Online (Sandbox Code Playgroud)
在清单文件中,application
指定您的主题
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
Run Code Online (Sandbox Code Playgroud)
如果您Manifest.xml
有默认值android:theme="@style/AppTheme"
转到res/values/styles.xml并进行更改
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
Run Code Online (Sandbox Code Playgroud)
至
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
Run Code Online (Sandbox Code Playgroud)
而且ActionBar
消失了!
小智 5
在中AndroidManifest.xml
,android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
在application
标签中设置。
各个活动可以通过设置自己的主题属性来覆盖默认设置。
归档时间: |
|
查看次数: |
105956 次 |
最近记录: |