Android开发技巧不同状态的Button
来源:互联网 发布:dsp算法优化 编辑:程序博客网 时间:2024/04/29 05:49
使用XML实现按钮改变焦点设置背景图,获得焦点时,获得焦点并按下,失去焦点时,默认时...
新建res/drawable/button.xml
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"><!-- 获得焦点时 --><itemandroid:state_focused="true"android:state_pressed="false"android:drawable="@drawable/focusimage"/><!-- 获得焦点并按下 --><itemandroid:state_focused="true"android:state_pressed="true"android:drawable="@drawable/clickimage"/><!-- 失去焦点时 --><itemandroid:state_focused="false"android:state_pressed="true"android:drawable="@drawable/clickimage"/><!-- 默认时 --><item android:drawable="@drawable/normal"/></selector>
main.xml
<?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:layout_marginTop="20dp" android:id="@+id/button" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="不同状态的Button" android:background="@drawable/button"/></LinearLayout>
- Android开发技巧不同状态的Button
- Android开发技巧不同状态的Button
- android开发小技巧(1)获取EditText确定button状态
- 不同状态下的button
- android 不同主题下不同状态的button 动态改变文字和图片
- android 根据button不同状态显示不同(背景)图片(background!!!!!)
- Android开发技巧:给Button的点击上色
- Android根据Button状态(normal,focused,pressed)显示不同背景图片
- Android根据Button状态(normal,focused,pressed)显示不同背景图片
- Android根据Button状态(normal,focused,pressed)显示不同背景图片
- Android根据Button状态(normal,focused,pressed)显示不同背景图片
- Android根据Button状态(normal,focused,pressed)显示不同背景图片
- Android根据Button状态(normal,focused,pressed)显示不同背景图片
- Android根据Button状态(normal,focused,pressed)显示不同背景图片
- android中如何实现button 不同状态显示切换背景图
- Android根据Button状态(normal,focused,pressed)显示不同背景图片
- Android根据Button状态(normal,focused,pressed)显示不同背景图片
- 使用 ButtonGroup 来管理不同状态的 Button 按钮组
- c 调用 python 异常的可能原因
- HTML5 实现小车动画效果(Canvas/CSS3/JQuery)
- rails设置主页不起作用(设置了 root to:'controller#action'以后)
- 在sqlserver中创建表
- 随便说说字符集和编码
- Android开发技巧不同状态的Button
- 心情真郁闷
- Spring对外部属性文件指定的某个属性进行加密、解密
- 多式样ProgressBar
- Tomcat内存溢出的三种情况及解决办法分析
- WINCE6.0 chain.bin和xipkernel.bin解析
- Android LinearLayout layout_weight适应屏幕布局
- 填写nsfc心得
- 学习 linq to ADO.NET 实例笔记(一)