Android(安卓)ApiDemos示例解析(18):App->Activity->Wallpaper
Wallpaper介绍一个Activity如何通过Style把系统Wallpaper作为当前Activity的背景。
这是WallpaperActivity在AndroidManifest.xml中的定义:
<activity android:name=”.app.WallpaperActivity”
android:label=”@string/activity_wallpaper”
android:theme=”@style/Theme.Wallpaper”>
<intent-filter>
< action android:name=”android.intent.action.MAIN” />
<category android:name=”android.intent.category.SAMPLE_CODE” />
< /intent-filter>
< /activity>
@style/Theme.Wallpaper定义如下:继承系统android:style/Theme.Wallpaper,并将前景色设为白色(这里是文字的颜色)
<!– A theme that has a wallpaper background. Here we explicitly specify
that this theme is to inherit from the system’s wallpaper theme,
which sets up various attributes correctly. –>
<style name=”Theme.Wallpaper” parent=”android:style/Theme.Wallpaper”>
<item name=”android:colorForeground”>#fff</item>
< /style>
Activity->Wallpaper" class="aligncenter size-full wp-image-1122" title="20110504005" width="337" height="495" src="https://img.it610.com/image/product/7bc89e29b35145e4ad7586c6f67a5619.jpg" style="border:1px solid black;">
更多相关文章
- RK3288 android7.1.2 android studio 用户空间通过spi ioctl读取
- XML 常见符号的实体定义:用在 Android(安卓)的 strings.xml 中
- Android中自定义组件及自定义属性
- Android(安卓)RoboGuice2 使用指南(3): Inject 自定义View
- 使用系统key文件生成keystore
- android-自定义Seekbar
- Android6.0系统增加那些新特性
- 搭建Android生产环境傻瓜教程(一)Ubuntu系统环境和常用软件
- System Permissions --1.4