Android xml实现Button背景图片
来源:互联网 发布:淘宝店铺只有pc端装修 编辑:程序博客网 时间:2024/05/17 17:15
1,在drarable文件夹下创建selector_common_btn.xml
xml中设置按钮获取焦点,按压,正常时的背景。并经过圆角处理。
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true"> <shape> <corners android:radius="2dp" /> <solid android:color="#FF0064D2" /> </shape> </item> <item android:state_pressed="true"> <shape> <corners android:radius="2dp" /> <solid android:color="#FF0064D2" /> </shape> </item> <item> <shape> <corners android:radius="2dp" /> <solid android:color="#FF0079FF" /> </shape> </item> </selector>
2,控件布局:
<Button style="@style/style_common_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_margin="2dp" android:background="@drawable/selector_common_btn" android:text="搜索" />
0 0
- Android xml实现Button背景图片
- Android xml实现Button背景图片
- Android 开发 圆角 Button 按钮 xml 实现
- Android开发--圆角 Button 按钮 xml 实现
- android中自定义Button,设置不同背景图片。
- android xml配置背景图片平铺
- android button 按下效果的代码,xml的实现
- 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状态(normal,focused,pressed)显示不同背景图片
- android selector(改变button,textview,listview的背景图片)
- Android根据Button状态(normal,focused,pressed)显示不同背景图片
- 点击button,button背景图片变化
- 存储过程引发的思考
- hdu1233 还是畅通工程 prim
- DesignPattern_Java:Abstract Factory Pattern
- 关于windows xp sp2/sp3 中tcpip.sys对于Raw socket的限制
- Java多线程编程-同步方法
- Android xml实现Button背景图片
- 安卓开发笔记三——对于EditText的一些简单属性设定
- 链表高效删除
- Android实战简易教程-第四十四枪(Ripple Effect-为控件增加涟漪效果)
- 无人机后门技术调研与确认
- 设计模式之原型模式---prototype
- 关于子线程更新UI
- Oracle快照原理及实现总结
- 前缀表达式、中缀表达式和后缀表达式