To add an XML file in drawable-hdpi
<?xml version="1.0"encoding="Utf-8"? ><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <shape> <gradient android:startcolor="#ff8c00"Android:endcolor="#FFFFFF"android:angle=" the"/> <stroke android:width="2DP"Android:color="#dcdcdc"/> <corners android:radius="10DP"/> <padding android:left="5DP"android:top="5DP"android:right="5DP"Android:bottom="5DP"/> </shape> </item> <item android:state_focused="true"> <shape> <gradient android:startcolor="#ffc2b7"Android:endcolor="#ffc2b7"android:angle=" the"/> <stroke android:width="2DP"Android:color="#dcdcdc"/> <corners android:radius="10DP"/> <padding android:left="5DP"android:top="5DP"android:right="5DP"Android:bottom="5DP"/> </shape> </item> <item> <shape> <gradient Android:startco Lor="#ff9d77"Android:endcolor="#ff9d77"android:angle=" the"/> <stroke android:width="2DP"Android:color="#fad3cf"/> <corners android:radius="10DP"/> <padding android:left="5DP"android:top="5DP"android:right="5DP"Android:bottom="5DP"/> </shape> </item> </selector>
button Style file
<?xml version="1.0"encoding="Utf-8"? ><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/red"Android:state_pressed="true"/> <!--What is displayed when pressed? Note: Picture conference exception--<item android:drawable="@drawable/red"Android:state_focused="true"/> <!--get focus--<item android:drawable="@drawable/backward"/> <!--The graphics displayed by default--></selector>
ImageView Style Files
Picture too large program exits unexpectedly
Set the Android:background property to
<imageview
Android:id= "@+id/image_back"
Android:clickable= "true"
Android:layout_width= "30dip"
android:layout_height= "30.0dip"
Android:scaletype= "Fitxy"
android:background= "@drawable/style_back_selector"/>
Android style buttons && pictures