************** 按下 更改 背景颜色 ********************
*************** 带图片的 *******
先是准备 背景素材,命名规则为
***_normal.9.png 正常状况
***_pressed.9.png 按下状况
附近附带若干窗口图片
然后 drawable 新建 样式 xml
btn_style_alert_dialog_button.xml
xmlns:android="http://schemas.android.com/apk/res/android">
可圆角样式
xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:android="http://schemas.android.com/apk/res/android">
如果要增加边框 在 shape 里 加
其中@color 在res/values/strings.xml
#2D3238
#3C4049
然后在 Button 中的background 中 加载 样式
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
android:id="@+id/btn_take_photo"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:layout_marginTop="20dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="拍照"
android:background="@drawable/btn_style_alert_dialog_button"
android:textStyle="bold"
/>
** android 按钮按下时改变字体颜色
1.新建 drawable/button_font_style.xml
2.添加至需要的xml里