I know there is a lots of other questions about this but I try all of them and nothing works for me. I want to create a button with 9 patch background. This is my 9 patch image :
I create this with draw9patch.bat in android sdk :
And I use this xml to create my button :
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/btnTest"
android:background="@drawable/ic_btn2" />
But the result is weird :
For test purpose I download some 9 patches and replace them with my image but those images have this problem too. I use android studio 2. what cause this problem?
Make sure the file's name ends with .9.png
.