ANDROID笔记:Button的简单使用
2013-10-15 10:54
330 查看
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/bnt_selector" android:text="登陆" android:textColor="#ffffff" /> <!-- 不可用状态 --> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/bnt_selector" android:enabled="false" android:text="登陆不可用" android:textColor="#ffffff" /> <!-- 带图片的按钮 --> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/bnt_selector" android:drawableTop="@drawable/ic_launcher" android:text="登陆" android:textColor="#ffffff" android:textSize="20sp" /> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- 不可用状态 --> <!-- 写在前面 --> <item android:drawable="@drawable/btn_small_null" android:state_enabled="false"></item> <!-- 点击状态 --> <item android:drawable="@drawable/btn_small_hover" android:state_pressed="true"></item> <!-- 未点击状态(平常状态) --> <item android:drawable="@drawable/btn_small" android:state_pressed="false"></item> </selector>
相关文章推荐
- Android 中 handle Message 的简单使用笔记
- Android笔记--使用Android自带的XML解析器PULL解析器简单的解析xml
- APIDemo学习笔记——Android上几种简单的Animation使用方法(三)——3D Transition
- [学习笔记]android的onCreate和Button的使用
- Android基础笔记(十三)- 内容提供者原理和简单使用
- Android 学习 笔记_12. Spinner的简单实使用
- ANDROID笔记:TextView的简单使用
- ANDROID笔记:ImageView的简单使用
- android菜鸟学习笔记31----Android使用百度地图API(二)获取地理位置及地图控制器的简单使用
- Android ImageButton 使用Selector的简单示例
- Android 6.0 FloatingActionButton简单使用
- APIDemo学习笔记——Android上几种简单的Animation使用方法
- Android 编程笔记 select的使用,Button的三种状态(未点击,点击,选中保持状态)
- ANDROID笔记:CheckBox的简单使用
- android笔记--简单的listactivity的使用
- 【Android笔记 三】Location获取地理位置信息(中)Criteria类的简单使用
- Android自学笔记-10-Sqlite的简单使用
- APIDemo学习笔记——Android上几种简单的Animation使用方法(一)
- android控件Button之简单使用
- android 自定义view学习笔记————Paint和Canvas的简单使用