Android开发 弹出框/页面样式设置 android:theme

Android弹出框/页面样式设置 android:theme

序号样式属性说明
1@android:style/Theme.Dialog普通弹出框 (如图1)
2@android:style/Theme.NoTitleBar无标题页面 (如图2)
3@android:style/Theme.NoTitleBar.Fullscreen无标题且全屏界面 (如图3)
4@android:style/Theme.Light白色背景界面 (如图4)
5@android:style/Theme.Light.NoTitleBar白色背景无标题界面
6@android:style/Theme.Light.NoTitleBar.Fullscreen白色背景无标题全屏界面
7@android:style/Theme.Black黑色背景界面
8@android:style/Theme.Black.NoTitleBar黑色背景无标题界面
9@android:style/Theme.Black.NoTitleBar.Fullscreen黑色背景无标题全屏界面
10@android:style/Theme.Wallpaper桌面壁纸为背景界面 (如图10)
11@android:style/Theme.Wallpaper.NoTitleBar桌面壁纸为背景无标题界面
12@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen桌面壁纸为背景无标题全屏界面
13@android:style/Theme.Translucent透明背景界面 (如图13)
14@android:style/Theme.Translucent.NoTitleBar透明背景无标题界面
15@android:style/Theme.Translucent.NoTitleBar.Fullscreen透明背景无标题全屏界面
16@android:style/Theme.Panel平板模式界面 (如图16)
17@android:style/Theme.Light.Panel白色背景平板模式界面

图1 弹出框页面
描述文字

图2 无标题页面
在这里插入图片描述

图3 无标题且全屏界面
在这里插入图片描述

图4 白色背景页面
在这里插入图片描述

图10 桌面壁纸为背景页面
在这里插入图片描述

图13 透明背景页面(页面内容为黑色的文本)

在这里插入图片描述

图16 平板模式页面
在这里插入图片描述
至此 问题完美解决

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
这段代码本身没有明显的错误,但是可以提供一些建议来改进它: 1. 在 `application` 元素中,只应该包含与应用程序相关的元素。例如,`android:dataExtractionRules` 和 `android:fullBackupContent` 应该移动到 `<application>` 标签之外。 2. 在 `MainActivity` 的声明中,`android:exported` 属性应该设置为 `false`,这可以防止其他应用程序调用该活动。 3. 在 `MainActivity2` 的声明中,`android:exported` 属性应该设置为 `true`,这可以让其他应用程序调用该活动。 这是修改后的代码: ``` <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> <uses-permission android:name="android.permission.SET_ALARM" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/Theme.MyApplication" tools:targetApi="31"> <activity android:name=".MainActivity" android:exported="false"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".MainActivity2" android:exported="true"> </activity> </application> <data-extraction-rules xmlns:android="http://schemas.android.com/apk/res/android" android:dataExtractionRules="@xml/data_extraction_rules" /> <full-backup-content xmlns:android="http://schemas.android.com/apk/res/android" android:fullBackupContent="@xml/backup_rules" /> </manifest> ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值