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
精彩评论