android shape with a repeated background
Asked Answered
C

1

7

I need to do a container with this background : enter image description here

the background has to repeat itself within this shape (rectangle with rounded top corners).

because it's for what i know impossible to perform that with a 9patch, i've looked into shapes, but here again, it seems impossible to get what I want...

    <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="rectangle">
    <corners 
        android:topRightRadius="20dp"
        android:topLeftRadius="10dp"
        android:bottomLeftRadius="0dp"
        android:bottomRightRadius="0dp"/>
    <solid 
        android:color="@color/red"/>

</shape>

i can't link the shape to my :

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

and, my shape has its 4 corners rounded ....

hope you'll help ! Thx, Renaud

Canarese answered 18/6, 2012 at 13:43 Comment(0)
I
0

Try using android:background="@drawable/point1sur4" instead of android:src="@drawable/point1sur4"

Ineludible answered 29/7, 2012 at 5:2 Comment(1)
Bitmap does not have a background propertyRevers

© 2022 - 2024 — McMap. All rights reserved.