开发者

How to Set JPG/PNG file as a Theme?

How to S开发者_高级运维et JPG/PNG file as a Theme of Mobile?


Create drawable/background.xml:

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/icon" />

Create values/styles.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CustomTheme" parent="android:Theme.Light">
    <item name="android:windowBackground">@drawable/background</item>
</style>
</resources>

And apply this theme to your activity or application in manifest.xml:

android:theme="@style/CustomTheme"

This theme applies the default image (icon.png) to the property windowBackground.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜