android通过shape实现虚线效果
来源:互联网 发布:oracle数据库使用手册 编辑:程序博客网 时间:2024/05/16 12:10
shape资源
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line"> <stroke android:dashGap="5dp" android:dashWidth="8dp" android:width="1dp" android:color="#70ffffff" /> <!-- 虚线的高度 --> <size android:height="1dp" /></shape>
layout文件设置background即可:
<View android:layout_width="match_parent" android:layout_height="2dp" android:layerType="software" android:background="@drawable/line_dash" />
有的设备会显示为实线,原因是4.0以上默认把Activity的硬件加速打开了,所以我们在Manifest.xml中关掉Activity的android:hardwareAccelerated="false"
不过不推荐这样实现,还是上面View层实现比较好。因为硬件加速有时候还是必要的!
1 0
- android通过shape实现虚线效果
- Android通过代码实现虚线或者虚线框shape
- Android 通过 shape 实现三角形气泡效果
- Android之shape设置虚线无效果
- Android shape的使用实现圆角,虚线,渐变等效果
- Android shape的使用实现圆角,虚线,渐变等效果
- Android shape的使用实现圆角,虚线,渐变等效果
- 通过自定义View实现虚线效果
- Android虚线分割Shape
- Android shape 画 虚线
- Android Shape绘制虚线
- Android虚线分割Shape
- Android通过xml shape画实线、虚线等常见几何图形
- Android通过shape实现边框
- Android通过shape实现边框
- android使用xml实现虚线效果
- android中通过shape定制图形效果
- Android—shape画虚线
- FMS 安装测试 自己进行
- 2016/9/7课上作业
- Idea中的快捷键
- XML解析
- 设计模式学习之路-观察者模式
- android通过shape实现虚线效果
- 新学年计划(9月-12月)
- jquery轮播特效(左右轮播)
- 判断当前设备是手机还是平板
- 第11章总结
- unity android设备上查看log输出
- 事件(2)——事件处理程序
- 第十一章总结
- 【排序】51NOD 1001-数组中和等于K的数对