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;">

更多相关文章

  1. RK3288 android7.1.2 android studio 用户空间通过spi ioctl读取
  2. XML 常见符号的实体定义:用在 Android(安卓)的 strings.xml 中
  3. Android中自定义组件及自定义属性
  4. Android(安卓)RoboGuice2 使用指南(3): Inject 自定义View
  5. 使用系统key文件生成keystore
  6. android-自定义Seekbar
  7. Android6.0系统增加那些新特性
  8. 搭建Android生产环境傻瓜教程(一)Ubuntu系统环境和常用软件
  9. System Permissions --1.4

随机推荐

  1. Python操作Redis,你要的都在这了!
  2. centos 网络配置1
  3. 如果我是Android面试官九
  4. Scrapy框架的使用之Scrapy通用爬虫
  5. 数据科学大佬的简历上都有哪些技能?
  6. 分布式爬虫的部署之Scrapyd-Client的使用
  7. 如何用Python递归地思考问题?
  8. Scrapy框架的使用之Scrapy框架介绍
  9. 还在抱怨pandas运行速度慢?这几个方法会颠
  10. 5个原因告诉你:为什么在成为数据科学家之