UI optimization
Button background flattening processing defines a black border, a white background picture as background
Black_border.xml
<?xml version= "1.0" encoding= "Utf-8"? ><shape xmlns:android= "Http://schemas.android.com/apk/res/android" > <corners android:radius= "5DP"/> <solid android:color= "@android: Color/white"/> < Stroke android:width= "0.5DP" android:color= "@android: Color/black"/></shape>
Black_border_pressed.xml
<?xml version= "1.0" encoding= "Utf-8"? ><shape xmlns:android= "Http://schemas.android.com/apk/res/android" > <corners android:radius= "5DP"/> <solid android:color= "@android: Color/holo_blue_light"/> <stroke android:width= "0.5DP" android:color= "@android: Color/black"/></shape>
Using Selector
<?xml version= "1.0" encoding= "Utf-8"? ><selector xmlns:android= "http://schemas.android.com/apk/res/ Android "> <item android:drawable=" @drawable/black_border_pressed "android:state_pressed=" true "/> <item android:drawable= "@drawable/black_border"/></selector>
Effects such as:
ListView Background Optimization:
- Android:divider= "@null", the interval for configuring item within the ListView is @null, i.e.-no interval.
- Android:background= "@null", Configuration without background
- android:dividerheight= "@dimen/list_dirver_height", configure the height of the split to "distance" between the--item.
Android Background Resource optimization-1