如何在Android中使用png-image作为9-patch-png?

时间:2011-08-08 10:25:12

标签: android drawable nine-patch

我们想在选择器中使用png-images作为背景:

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

其中inputfield_text_bg_active和inputfield_text_bg是我们的png-images

拉伸有问题,看起来不太好。

有没有办法使用这个png而不将它们转换为9-patch-png?

2 个答案:

答案 0 :(得分:0)

您可以尝试这样的事情:

Background in tab widget ignore scaling

无论视图大小如何,基本上都会限制缩放。

答案 1 :(得分:-1)