I am using a shape XML drawable as a background of a LinearLayout.
File: background.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:angle="270"
android:endColor="@color/bg_end_blue"
android:startColor="@color/bg_start_blue" />
<corners android:radius="0dp" />
</shape>
Then I read about dithering and how this can improve the look of this background (via this article http://android.amberfog.com/?p=247), thus I created this bitmap XML drawable:
File: background_bitmap.xml
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:dither="true"
android:src="@drawable/background"
android:tileMode="repeat" />
And tried it to apply to the LinearLayout. But I get a:
org.xmlpull.v1.XmlPullParserException: Binary XML file line #5: <bitmap> requires a valid src attribute
Do you know what I am doing wrong? Thanks in advance!!