I have a problem with custom background for button. There's my 9-patch:
Same in Draw 9-patch:
And, finally, result on device's screen:
And that's the code, describing my button:
Layout:
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="New Button"
style="@style/button"/>
Style:
<style name="button">
<item name="android:background">@drawable/button</item>
<item name="android:textColor">@color/button_text</item>
</style>
@drawable/button
:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false" >
<bitmap android:src="@drawable/button_test"/>
</item>
</selector>
File name of drawable in res folders is button_test.9.png
Do you have any ideas why it doesn't work? Thank you.
remove bitmap tag inside item tag, add android:drawable attribute within item tag