Android之view虚线
16lz
2021-01-24
使用环境:
偶尔会用到,一根虚线………………
使用方法:
小技巧讲述: view的height一定要比shape中line的height高! 第二,shape中要有
上代码:
<?xml version="1.0" encoding="utf-8"?>xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="@dimen/two" android:background="@drawable/dashfive" android:layerType="software" />
dashfive/drawablw
<?xml version="1.0" encoding="utf-8"?>至于xml文件是怎么写的,平时一根线怎么写就怎么写,但是要加一条属性:xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line"> android:width="1dp" android:color="#999999" android:dashGap="5dp" android:dashWidth="5dp" /> android:height="@dimen/one"/>
android:layerType="software"
出来的效果是:
亲测,AS版本3.0,Android版本5.1,管用!
更多相关文章
- Android:读写权限授予后仍提示 Permission denied!
- android 程序发布
- 解决Android(安卓)4.2.2 脱机(offline)问题
- android项目在不同平台切换的问题
- 内核版本与Android版本对应关系
- Android圆角bug
- Android开发系列之搭建开发环境
- Android网络请求库——android-async-http
- Android(安卓)Studio生成Release版本问题---Could not download