android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen"相关问题
2017-11-02 23:00
316 查看
1.先说一下这个主题的意思:用系统桌面为应用程序背景,无标题栏,全屏
2.百度上很多都是写的不全的只是简单的列出了自带的theme,然后就没其他东西了
3.这里说一下要使用这个主题,首先按博客标题上这么写android:theme=”Theme.Wallpaper.NoTitleBar.Fullscreen”是错误的,而百度上大部分都是这么写的,正确的写法应该是
4.其次现在用android studio创建的新项目,自动生成的MainActivity都是默认继承的AppCompatActivity,但是实际demo测试中不能继承AppCompatActivity而要改为Activity才能正常运行,不然在这个父类下该主题照样报错
5.效果图:
6.下面列举部分theme,以供参考
如果你打算在程序代码中来加载主界面的主题,那么需要注意主题当中不能包括任何系统启动这个Activity所使用的动画,这些动画将在程序启动前显示。在很多情况下,如果你想将主题应用到你的主界面,在XML中定义似乎是一个更好的办法。
下面的前三个之外直接复制就会出错。@是说明系统已经定义过的,
@android:style/ 是必须带上的。
?android:theme=”@android:style/Theme.Dialog” 将一个Activity显示为对话框模式
?android:theme=”@android:style/Theme.NoTitleBar” 不显示应用程序标题栏
?android:theme=”@android:style/Theme.NoTitleBar.Fullscreen” 不显示应用程序标题栏,并全屏
?android:theme=”Theme.Light” 背景为白色
?android:theme=”Theme.Light.NoTitleBar” 白色背景并无标题栏
?android:theme=”Theme.Light.NoTitleBar.Fullscreen” 白色背景,无标题栏,全屏
?android:theme=”Theme.Black” 背景黑色
?android:theme=”Theme.Black.NoTitleBar” 黑色背景并无标题栏
?android:theme=”Theme.Black.NoTitleBar.Fullscreen” 黑色背景,无标题栏,全屏
?android:theme=”Theme.Wallpaper” 用系统桌面为应用程序背景
?android:theme=”Theme.Wallpaper.NoTitleBar” 用系统桌面为应用程序背景,且无标题栏
?android:theme=”Theme.Wallpaper.NoTitleBar.Fullscreen” 用系统桌面为应用程序背景,无标题栏,全屏
?android:theme=”Translucent”
?android:theme=”Theme.Translucent.NoTitleBar” 半透明,无标题
?android:theme=”Theme.Translucent.NoTitleBar.Fullscreen” 半透明,无标题,全屏
?android:theme=”Theme.Panel” 面板风格显示
?android:theme=”Theme.Light.Panel” 平板风格显示
2.百度上很多都是写的不全的只是简单的列出了自带的theme,然后就没其他东西了
3.这里说一下要使用这个主题,首先按博客标题上这么写android:theme=”Theme.Wallpaper.NoTitleBar.Fullscreen”是错误的,而百度上大部分都是这么写的,正确的写法应该是
android:theme="@android:style/Theme.Wallpaper.NoTitleBar"
4.其次现在用android studio创建的新项目,自动生成的MainActivity都是默认继承的AppCompatActivity,但是实际demo测试中不能继承AppCompatActivity而要改为Activity才能正常运行,不然在这个父类下该主题照样报错
5.效果图:
6.下面列举部分theme,以供参考
如果你打算在程序代码中来加载主界面的主题,那么需要注意主题当中不能包括任何系统启动这个Activity所使用的动画,这些动画将在程序启动前显示。在很多情况下,如果你想将主题应用到你的主界面,在XML中定义似乎是一个更好的办法。
下面的前三个之外直接复制就会出错。@是说明系统已经定义过的,
@android:style/ 是必须带上的。
?android:theme=”@android:style/Theme.Dialog” 将一个Activity显示为对话框模式
?android:theme=”@android:style/Theme.NoTitleBar” 不显示应用程序标题栏
?android:theme=”@android:style/Theme.NoTitleBar.Fullscreen” 不显示应用程序标题栏,并全屏
?android:theme=”Theme.Light” 背景为白色
?android:theme=”Theme.Light.NoTitleBar” 白色背景并无标题栏
?android:theme=”Theme.Light.NoTitleBar.Fullscreen” 白色背景,无标题栏,全屏
?android:theme=”Theme.Black” 背景黑色
?android:theme=”Theme.Black.NoTitleBar” 黑色背景并无标题栏
?android:theme=”Theme.Black.NoTitleBar.Fullscreen” 黑色背景,无标题栏,全屏
?android:theme=”Theme.Wallpaper” 用系统桌面为应用程序背景
?android:theme=”Theme.Wallpaper.NoTitleBar” 用系统桌面为应用程序背景,且无标题栏
?android:theme=”Theme.Wallpaper.NoTitleBar.Fullscreen” 用系统桌面为应用程序背景,无标题栏,全屏
?android:theme=”Translucent”
?android:theme=”Theme.Translucent.NoTitleBar” 半透明,无标题
?android:theme=”Theme.Translucent.NoTitleBar.Fullscreen” 半透明,无标题,全屏
?android:theme=”Theme.Panel” 面板风格显示
?android:theme=”Theme.Light.Panel” 平板风格显示
相关文章推荐
- android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen"设置全屏程序闪退解决办法
- 项目中添加 android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"应用崩溃
- android全屏设置代码:android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
- android Theme 设置为Android:style/Theme.Light.NoTitleBar.Fullscreen 程序秒退
- android:theme="@android:style/Theme.NoTitleBar"
- android:theme="@android:style/Theme.NoTitleBar"
- android的Theme.Light.NoTitleBar和Theme.Light.NoTitleBar.Fullscreen的区别
- 解决安卓manifest中的application标签中@android:style/Theme.NoTitleBar崩溃的问题
- 解决android:theme="@android:style/Theme.NoDisplay" 加入这句话后程序不能运行
- android:theme="@android:style/Theme.NoDisplay"
- android:theme和app:popupTheme的作用,以及在android 3.0以下不起作用问题的解决
- Android问题集锦之二十八:You need to use a Theme.AppCompat theme (or descendant) with this activity.
- android编程取消标题栏方法(appcompat_v7、Theme.NoTitleBar)
- [Androidstudio]的坑之【@android:style/Theme.Black.NoTitleBar】
- 解决无法在theme中设置NoTitleBar属性的问题
- Android开发笔记之主题背景的修改(设置Theme.NoTitleBar后Activity背景变成黑色)
- 安卓 Theme.NoTitleBar 添加之后崩溃的问题
- Activity设置fullscreen或no title bar
- 为什么在AndroidManifest.xml中Activity的theme用不了Theme.Light.NoTitleBar?
- android:theme和app:popupTheme的作用,以及在android 3.0以下不起作用问题的解决