开发者

How to add a 9patch image to a xml drawable

开发者 https://www.devze.com 2022-12-29 08:53 出处:网络
I have the following drawable which draw a rectangle. Can you please tell me how can开发者_开发问答 I add a 9patch image as the background of this drawable?

I have the following drawable which draw a rectangle. Can you please tell me how can开发者_开发问答 I add a 9patch image as the background of this drawable?

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
> 
<stroke android:width="1dp" android:color="#FFFFFFFF" /> 
<solid android:color="@android:color/transparent"/>
</shape>

Thank you.


You can't use a drawable for that, but you can use a

<layer-list>
  <item android:drawable="@drawable/mydrawable" />
  <item>
    <shape>...</shape>
  </item>
</layer-list>
0

精彩评论

暂无评论...
验证码 换一张
取 消