九个补丁StateListDrawable渲染问题

b_y*_*yng 5 android android-layout

从版本12 更新到SDK工具版本15后,我的EditTexts和Buttons都显示为扭曲...

它现在看起来如何 过去看起来如何

现在这是修改的错误吗?因为当我使用"图形布局"选项卡预览布局时,它看起来很正常.但是一旦它被编译并放在我的手机或模拟器上,就会失真.

这是按钮的StateListDrawable xml.在此引用的每个drawable是9patch.EditTexts以相同的方式完成.

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/button_grey_pressed" android:state_pressed="true"></item>
    <item android:drawable="@drawable/button_grey_pressed" android:state_focused="true"></item>
    <item android:drawable="@drawable/button_grey_pressed" android:state_selected="true"></item>
    <item android:drawable="@drawable/button_grey_default"></item>
</selector>
Run Code Online (Sandbox Code Playgroud)

Man*_*sto 2

我更新到 SDK 14 时也遇到过这个问题。

Window>Preferences>Android>Build我通过设置“构建输出”Normal然后找到了解决方案Project>Clean>Clean All