2012-06-18 126 views
4

Android的形狀,我需要做的容器在這樣的背景:enter image description here與重複背景

背景有這種形狀(矩形圓角上角)內重演。

,因爲它是什麼,我知道不可能執行有9patch, 我已經研究過的形狀,但在這裏再次,這似乎是不可能得到我想要的東西......

<?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> 

我可以「T形狀鏈接到我的:

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

和我的外形有4個角圓潤....

希望你能幫助! THX, 雷諾

回答

0

使用android:background="@drawable/point1sur4「,而不是android:src="@drawable/point1sur4"

+0

位圖嘗試不具有背景屬性 – mGolzadh