zoukankan      html  css  js  c++  java
  • android 画竖虚线

    参考:http://blog.csdn.net/zhao2017/article/details/73866460

    1.在Android中写横虚线比较简单,写竖虚线的话稍微麻烦点: 
    需要将写的虚线旋转: 
    这里面旋转角度设置为90 到90。

    <rotate xmlns:android="http://schemas.android.com/apk/res/android"
        android:fromDegrees="90"
        android:toDegrees="90">
    
        <shape android:shape="line">
            <stroke
                android:width="1dp"
                android:color="#ebebeb"
                android:dashGap="1dp"
                android:dashWidth="2dp" />
    
            <size
                android:width="200dp"
                android:height="3dp"></size>
        </shape>
    
    </rotate>
    •  

    然后在用的地方可以将View的宽度设置的很大,以免周边的View影响其显示。

    竖虚线在实际中用到的地方。

      <View
                android:id="@+id/view"
                android:layout_width="100dp"
                android:layerType="software"
                android:layout_height="match_parent"
                android:layout_marginLeft="-40dp"
                android:layout_marginRight="-10dp"
                android:layout_toRightOf="@id/tv_number"
                android:background="@drawable/main_red_pck_dash_line"
                >
    
            </View>
    •   
  • 相关阅读:
    啃掉的博文全记录
    DP五十题
    noip 真题班刷题记录及总结思考
    dfklsJj
    【2018.11.7】luogu NOIp热身赛 及刷题思考
    【trie树专题】
    【倍增专题】
    10.23
    简析 NP 问题 和P问题
    [NOIP 2010普及组 No.4] 三国游戏
  • 原文地址:https://www.cnblogs.com/manmanlu/p/8318611.html
Copyright © 2011-2022 走看看