使用笔触颜色,角落和实心可绘制创建可绘制的形状

时间:2013-01-23 08:08:50

标签: android android-drawable

我想创建一个形状:solid是一个Bitmap(重复的tile),而stroke是一种颜色。我使用LayerList:

    <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
    <item android:id="@+id/additional_image"
        android:drawable="@drawable/bg_detail_loop"
        >
    </item>
    <item android:id="@+id/rounded_corners"
        android:drawable="@drawable/shape_box_dlg">
    </item>
</layer-list>

文件bg_detail_loop.xml:

<bitmap xmlns:android="http://schemas.android.com/apk/res/android" 
    android:filter="true"
    android:gravity="center"
    android:tileMode="repeat"
    android:src="@drawable/tile_detail"
    />

文件shape_box_dlg.xml:

<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <stroke
        android:width="2dip"
        android:color="#EE6A1F" />
    <gradient android:angle="270" />
    <corners android:radius="6dp" />
</shape>

但是,在角落里,背景Bitmap没有剪辑。我想要圆角。有人帮帮我吗?感谢

0 个答案:

没有答案
相关问题