Android shape、selector的使用
来源:互联网 发布:vgn p17h装linux 编辑:程序博客网 时间:2024/05/16 01:59
首先在res下新建文件夹drawable,然后创建Android XML File
1.四个角圆角、填充白色、描边灰色
<span style="font-size:14px;"><?xml version="1.0" encoding="UTF-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" > <!-- 填充的颜色 --> <solid android:color="#ffffff" /> <!-- android:radius 弧形的半径 --> <corners android:radius="10dp" /> <!-- 描边 --> <stroke android:width="1dp" android:color="#f8f8f8" /></shape></span>
2.右边不需要描边(那条边不需要描边,只需将right改成相应的边)
<span style="font-size:14px;"><?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:right="-5dp"> <shape> <solid android:color="#5c5c5c" /> <stroke android:width="2dp" android:color="#ff8840" /> </shape> </item></layer-list></span>
3.点击更换背景颜色
<span style="font-size:14px;"><?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="false"><shape android:shape="rectangle"> <solid android:color="#ffffff" /> <corners android:radius="8dp" /> </shape></item> <item android:state_pressed="true"><shape android:shape="rectangle"> <solid android:color="#000000" /> <corners android:radius="8dp" /> </shape></item></selector></span>
1 0
- Android shape、selector的使用
- Android中 shape和selector的使用
- android中shape与selector的使用
- [Android]shape和selector的结合使用
- android关于selector和shape的使用
- Android中Shape和selector的使用
- Android中shape和selector的使用
- shape、selector的使用
- shape、selector的使用
- Android:shape和selector使用
- android selector中使用shape
- Android的Selector与Shape
- Android Button的Selector+Shape
- shape和selector的 使用
- selector,shape的自定义使用
- shape和selector的使用
- [Android]android shape与selector的使用20160516
- Android开发教程:shape和selector的结合使用
- 将就OR讲究? ——APP如何成功上线
- 【Android短信拦截】自动填充短信验证码
- #(使用无效,另一种方式实现第一个变量添加外部变量名)
- spring启动加载程序的几种方法
- MySQL 加锁处理分析
- Android shape、selector的使用
- leetcode_344_ Reverse String(C++)(easy)
- canvas实现微信朋友圈猜照片功能
- 欢迎使用CSDN-markdown编辑器
- 直接插入排序
- 通过搜索异步获取百度图片
- 网站压力测试工具 Webbench
- Maven 手动设置本地jar包,设置国内资源库,设置项目编码
- [LeetCode]Candy——分糖果问题