Android XML绘图Shape虚线
来源:互联网 发布:黄道日与黑道日的算法 编辑:程序博客网 时间:2024/05/24 06:27
Shape虚线
1、在Drawable上面写Shape的XML文件
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line" > <stroke //边框 android:width="1dp" android:color="@color/bg_shop" android:dashGap="5dp" //虚线间隔 android:dashWidth="5dp" /> //虚线宽度 <!-- 虚线的高度 --> <size android:height="0.2dp" /></shape>
2、在布局XML设置shape
<View android:layout_width="match_parent" android:layout_height="1.5dp" android:layout_below="@+id/view_head" android:layout_marginLeft="@dimen/dp_22" android:layout_marginRight="@dimen/dp_22" android:layout_marginTop="123.8dp" android:background="@drawable/line_dotted" android:layerType="software"/>
3、效果图
PS:dashGap //虚线间隔,dashWidth //虚线宽度
必须得加上android:layerType=”software”,否则不生效,成直线。
阅读全文
0 0
- Android XML绘图Shape虚线
- Android XML绘图-Shape
- android xml 绘图 shape 解析
- Android XML绘图之 Shape
- Android XML绘图shape 圆角
- Android XML绘图Shape阴影
- Android虚线分割Shape
- Android shape 画 虚线
- Android Shape绘制虚线
- Android虚线分割Shape
- Android 绘图XML——Shape
- Android xml绘图(二)-----------Shape
- Android通过xml shape画实线、虚线等常见几何图形
- Android—shape画虚线
- Android利用shape画虚线
- android利用shape画虚线
- android用shape画虚线
- android 使用shape 画虚线
- NULL、空格串、空字符串、0的区别和NULL详解及拓展
- Linux 编写C程序
- python--推导式
- hdu 3389 Game(阶梯博弈)
- Weave 网络结构分析
- Android XML绘图Shape虚线
- python -- 函数以及函数式编程
- Java数组问题、实例、输入、字符;入门基础
- python lambda表达式的介绍和使用
- python--包、模块、异常
- 六天带你玩转Mysql笔记---第一天
- Linux学习(五):shell命令用户系统相关命令
- sublime3添加verilog自动补全代码段
- 单例模式——静态内部类式