I have a set of four 9patch images I wish to use for a button (ldpi to xhdpi). It appears normally on the UI designer in eclipse, but on the emulator and on my android device it stretches the image as if it were not 9patch.
Images (I can only post two links max, sorry):
ldpi https://i.sstatic.net/c2D6s.png
mdpi https://i.sstatic.net/G7ZzG.png
hdpi (link limit reached, sorry)
xhdpi (link limit reached, sorry)
Here is the button XML:
<Button
android:id="@+id/button1"
style="@style/loginstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/imageView2"
android:layout_alignLeft="@+id/imageView1"
android:layout_alignRight="@+id/imageView1"
android:layout_marginBottom="97dp"
android:onClick="onLogin"
android:padding="0dp"
android:paddingBottom="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
android:text="Login"
android:textColor="#fff" />
Here is my style code:
<style name="loginstyle">
<item name="android:background">@drawable/loginbuttondr</item>
</style>
Here is my drawable xml (loginbuttondr.xml):
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false" android:drawable="@drawable/loginbutton"/>
</selector>
The image set is named loginbutton.9.png
SOLUTION: Thanks to @MoshEsran. The issue was that I had not added the fill guidelines (right and bottom sides) to the image.
Problem might be your patch line color is not pure black.
You must use #000000, however, currently you are having #101a05