首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

android > 按钮Button 按上效果

2013-01-28 
android 按钮Button 按下效果先是准备 背景素材,命名规则为***_normal.9.png ? 正常状况***_pressed.9.p

android > 按钮Button 按下效果

先是准备 背景素材,命名规则为

***_normal.9.png ? 正常状况

***_pressed.9.png ? 按下状况

附近附带若干窗口图片

?

然后?drawable 新建 样式 xml?

btn_style_alert_dialog_button.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/btn_style_alert_dialog_special_pressed" />    <item android:drawable="@drawable/btn_style_alert_dialog_special_normal" /></selector>

?

然后在 Button 中的background 中 加载 样式

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    android:orientation="vertical" >    <Button        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"         />            </LinearLayout>

?


android > 按钮Button 按上效果
?

?

?

?

?

?

热点排行