I'm trying to test a way to make themes, but the approach I used isn't giving me the expected results. Here my setup:
drawable/dummy.xml
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/icon" />
values/mythemes.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyOrange" parent="android:style/Theme">
<item name="@drawable/dummy">@style/imgOrange</item>
</style>
<style name="MyBlue" parent="android:style/Theme">
<item name="@drawable/dummy">@style/imgBlue</item>
</style>
<style name="imgOrange">
<item name="android:src">@drawable/orange</item>
</style>
<style name="imgBlue">
<item name="android:src">@drawable/blue</item>
</style>
</resources>
layuot/main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
<ImageView android:id="@+id/imageView1"
android:src="@drawable/dummy"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
</ImageView>
</LinearLayout>
I don't get any error, but it doesn't change theme either.
I tryed to use also a style as a "dummy" but it does the same thing.
Any idea/explanation?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…