Android 双线边框
来源:互联网 发布:三国群英传8武将数据 编辑:程序博客网 时间:2024/04/30 10:23
平常背景框都是一条线,对于两条线的背景框,确无从下手,而且shape里面的知识
还是很多的,每看过一次,下次就忘了怎么用。今天既然实现了,就记个笔记,让别
人查找也方便吧。
效果图如下:
1.实线
2.虚线
那么直接贴代码咯
第一种效果:实——实——线
<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <corners android:radius="5dp" /> <stroke android:width="0.5dp" android:color="@color/Black" /> </shape> </item> <item android:bottom="4dp" android:left="4dp" android:right="4dp" android:top="4dp"> <shape android:shape="rectangle"> <corners android:radius="5dp" /> <stroke android:width="0.5dp" android:color="@color/Black" /> </shape> </item></layer-list>
<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <corners android:radius="0dp" /> <stroke android:width="0.5dp" android:color="@color/Red" /> </shape> </item> <item android:bottom="4dp" android:left="4dp" android:right="4dp" android:top="4dp"> <!-- 显示一条虚线,破折线的宽度为dashWith,破折线之间的空隙的宽度为dashGap,当dashGap=0dp时,为实线 --> <shape android:shape="rectangle"> <stroke android:width="1dp" android:color="@color/Black" android:dashGap="3dp" android:dashWidth="4dp" /> <!-- 虚线的高度 --> <size android:height="1dp" /> </shape> </item></layer-list>
直接用到项目里面去试试吧。如果编辑器里面显示的不对,大家
不要担心,安装到手机上的效果才是最终效果。切
记哦!!!
我的编辑器的效果给你们看看,
对吧,这明明不是上面的手机效果,楼主,你骗我,赔钱!!!
这,这,这,这个,博主也收入低微,业余在路边乞讨为生,真赔不起呀!!!嘿嘿嘿,开个小玩笑。
大家不用担心啦。最终效果,以手机上为主。。。实验见证真理嘛。日后还需努力,大家加油加油咯。
2 0
- Android 双线边框
- CSS双线边框研究
- RichView去掉双线边框
- 解决表格中边框双线的问题
- Android 边框,只有底部边框
- 在IE和firefox中同时实现经典双线凸出边框
- Android设置上下边框,或者左右边框
- Android ImageView 加边框
- android editText 自定义边框
- android ImageView 添加边框
- android圆角边框
- Android 图片加边框
- android 自定义edittext边框
- android dialog去除边框
- Android TableLayout 实现边框
- Android边框圆角
- android 背景边框变圆角
- Android图片加边框
- apple-touch-icon-precomposed 和 apple-touch-icon属性区别
- java transient简介
- Android 的notification 的intent 传值
- C Socket编程之Connect超时
- Gradle配置一次性打包不同的渠道
- Android 双线边框
- HTML5之SVG 2D入门8 - 文档结构
- IOS UITableView索引排序功能
- oj水题-发金牌
- java设计模式之适配器模式
- 防止SQL注入
- Hibernate批量添加与更新
- centos 7 安装 crowd2.8和集成jira6.3.3和confluence5.8
- [项目回顾]基于Redis的在线用户列表解决方案