展会信息港展会大全

Android ApiDemos示例解析(18):App->Activity->Wallpaper
来源:互联网   发布日期:2016-01-14 10:50:34   浏览:1957次  

导读:Wallpaper介绍一个Activity如何通过Style把系统Wallpaper作为当前Activity的背景。这是WallpaperActivity在AndroidManifest.x...

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>

作者:mapdigit

赞助本站

人工智能实验室

相关热词: android开发 教程

AiLab云推荐
推荐内容
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港