1.Button控件样式
A.效果图
B.布局
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/btn_bg"
android:text="确定"
android:textColor="@android:color/white"
android:textSize="16sp" />
C.shape背景
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 按下 -->
<item android:state_pressed="true">
<shape>
<!-- 边框颜色 -->
<stroke android:color="@android:color/holo_blue_light" android:width="1dp" />
<!-- 填充色 -->
<solid android:color="@android:color/holo_blue_light" />
<!-- 实现圆角 -->
<corners android:radius="5dp" />
</shape>
</item>
<!-- 获得焦点 -->
<item android:state_focused="true">
<shape>
<!-- 边框颜色 -->
<stroke android:color="@android:color/holo_blue_light" android:width="1dp" />
<!-- 填充色 -->
<solid android:color="@android:color/holo_blue_light" />
<!-- 实现圆角 -->
<corners android:radius="5dp" />
</shape>
</item>
<!-- 正常状态 -->
<item>
<shape>
<!-- 边框颜色 -->
<stroke android:color="@android:color/holo_blue_dark" android:width="1dp" />
<!-- 填充色 -->
<solid android:color="@android:color/holo_blue_dark" />
<!-- 实现圆角 -->
<corners android:radius="5dp" />
</shape>
</item>
</selector>
2.EditText输入文本控件样式
A.效果图
B.布局
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:background="@drawable/edit_text_bg"
android:gravity="left"
android:hint="请反馈您的宝贵意见^_^"
android:minLines="2"
android:padding="5dp"
android:textSize="16sp" />
C.shape背景
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 边框颜色 -->
<stroke
android:width="1px"
android:color="@android:color/darker_gray" />
<!-- 填充色 -->
<solid android:color="@android:color/white" />
<!-- 实现圆角 -->
<corners android:radius="5dp" />
</shape>
3.RadioButton单选框样式
A.效果图
![](http://wiki.cnsuning.com/download/attachments/27166736/image2016-11-7%2019%3A34%3A27.png?version=1&modificationDate=1478518467234&api=v2)
B.布局
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:padding="8dip">
<RadioButton
android:id="@+id/rb_oms"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/radio_box_bg"
android:checked="true"
android:paddingLeft="5dp"
android:text="销单完成" />
<RadioButton
android:id="@+id/rb_merge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dip"
android:button="@drawable/radio_box_bg"
android:paddingLeft="5dp"
android:text="销单改期" />
</RadioGroup>
C.shape背景
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false" android:drawable="@drawable/radio_unselected" />
<item android:state_checked="true" android:drawable="@drawable/radio_selected" />
</selector>
4.CheckBox多选框样式
A.效果图
B.布局
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/check_box_bg"
android:paddingLeft="5dp"
android:text="玄武" />
C.shape背景
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false" android:drawable="@drawable/check_box_normal" />
<item android:state_checked="true" android:drawable="@drawable/check_box_selected" />
</selector>
5.Spinner下拉菜单(下拉弹出框)
A.效果图
B.布局
<Spinner
android:id="@+id/spinner"
android:layout_margin="8dip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:spinnerMode="dialog"
android:overlapAnchor="false"
android:background="@drawable/spinner_selector" />
C.shape背景
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_focused="true"
android:state_pressed="false"
android:drawable="@drawable/spinner_bg" />
<item
android:state_focused="true"
android:state_pressed="true"
android:drawable="@drawable/spinner_bg_dianji" />
<item
android:state_focused="false"
android:state_pressed="true"
android:drawable="@drawable/spinner_bg_dianji" />
<item
android:drawable="@drawable/spinner_bg" />
</selector>