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.
精彩评论