Reputation: 14136
After updating to SDK tools revision 15 from revision 12, my EditTexts and Buttons all appear distorted like so...
Now is this a bug with the revision? Because when I preview what the layout looks like with the "Graphical Layout" tab it appears normal. But as soon as it is compiled and put on my phone or the emulator, it is distorted.
Here is the StateListDrawable xml for the buttons. Each drawable referenced in this is a 9patch. The EditTexts are done in the same fashion.
<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>
Upvotes: 5
Views: 622
Reputation: 11
I've copied and pasted from here and it worked:
- Disable auto-refresh, build automatically.
- Full clean all projects.
- Build all projects.
- Clean the main project.
- Build the main project.
Upvotes: 1
Reputation: 1505
This is an issue I've had too when I updated to SDK 14.
I found a solution in Window>Preferences>Android>Build
by setting "Build output" on Normal
and then Project>Clean>Clean All
.
Upvotes: 2
Reputation: 8390
Try wrapping those nine-patch drawables (I suppose @drawable/button_grey_pressed
refers to /drawable/button_grey_pressed.9.png
) into xml nine-patch drawables:
<?xml version="1.0" encoding="utf-8"?>
<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/button_grey_pressed"
android:dither="true" />
You will have to give this xml file the name which will be different from that of button_grey_pressed.9.png
, let's say button_grey_pressed9.xml
Upvotes: 0