Saturday, 26 September 2015

custom button


Custom button
other than having a png image in drawable we also need a xml in drawable the will totally define the button that we have
xml example

<item android:state_presses="true" android:drawable="@drawable/plusselected"></item>
<item android:state_focused="true" android:drawable="@drawable/plushlight"></item>
<item android:drawable="@drawable/plus"></item>


now in the xml where the actual button resides , we should change the
layout width and height to wrap_content , so that the image remains to itself
and the background of the button should be @drawable/ourxml

No comments:

Post a Comment