486
No
R.layout.activity_main
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="org.androidtown.myselector.MainActivity">
<Button
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginTop="171dp"
android:id="@+id/button"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@drawable/arrow_left_selector" />
<!--백그라운드에 xml 을 지정한다.-->
</RelativeLayout>
arrow_left_selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 버튼을 눌렀을 경우-->
<item
android:state_pressed="true"
android:drawable="@drawable/arrow_left_clicked"
/>
<!--정상적인경우-->
<item
android:drawable="@drawable/arrow_left_normal"
/>
</selector>
댓글 ( 4)
댓글 남기기