zoukankan      html  css  js  c++  java
  • shape- 设置虚线

    <?xml version="1.0" encoding="utf-8"?>
        <shape xmlns:android="http://schemas.android.com/apk/res/android"
            android:shape="line" > 
    <!--虚线相关参数-->
    <stroke android:dashGap="3dp" android:dashWidth="6dp" android:width="0.5dp" android:color="#19000000" />
    <!--这个必须设置,而且值要比上面的大-->
    <size android:height="20dp" /> </shape>

    参数意义:

    android:dashGap="3dp":表示的是虚线的长度
    android:dashWidth="6dp":表示的是实线的长度
     android:width="0.5dp":线的宽度
    android:color="#19000000":颜色
    android:height="20dp":意义不明,但是,如果设定值小于<stroke>中的width的话,虚线不显示

    注意:在4.0,你会发现虚线显示的是直线,方法就是在引用这个直线的view,添加属性,如下
     <View
            style="@style/separator_style"
    <!--显示虚线的必须属性-->
    android:layerType
    ="software" android:background="@drawable/divider_horizontal_dot_line" android:layout_width="0dip" android:layout_weight="1" />
     
  • 相关阅读:
    Excel Sheet Column Number
    Compare Version Numbers
    Min Stack
    Excel Sheet Column Title
    Find Peak Element
    数据规范化
    Majority Element
    用户唯一登录
    面试总结——Java高级工程师(三)
    Spring AOP 实战运用
  • 原文地址:https://www.cnblogs.com/zhangshuli-1989/p/zhangshuli_zj_15011923.html
Copyright © 2011-2022 走看看