Skip to content

Instantly share code, notes, and snippets.

@daichan4649
Created August 30, 2012 09:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daichan4649/3524858 to your computer and use it in GitHub Desktop.
Save daichan4649/3524858 to your computer and use it in GitHub Desktop.
Button(+selector) sample
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="false"
android:drawable="@drawable/button_normal" />
<item
android:state_pressed="true"
android:drawable="@drawable/button_pressed" />
</selector>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/button_selector"
android:text="Button" />
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment