开发者

How to use an png-image as 9-patch-png in Android?

we wanna use png-images as background in a selector:

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_focused="true" android:drawable="@drawable/inputfield_text_bg_active" />
    <item android:drawable="@drawable/inputfield_text_bg" />
</selector>

where inputfield_text_bg_active and inputfield_text_bg ar开发者_如何学JAVAe our png-images

And there is the problem with stretching, it doesn't look nice.

Is there a way to use this pngs without converting them to 9-patch-png?


You could try something like this:

Background in tab widget ignore scaling

Basically limit the scaling regardless of the size of the view.


I think this links are helpful for u

http://developer.android.com/guide/developing/tools/draw9patch.html

http://www.android10.org/index.php/articlesother/279-draw-9-patch-tutorial

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜