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>
    •   
  • 相关阅读:
    ES6常用语法简介
    webpack核心概念
    前端模块化规范详解
    使用Node.js原生代码实现静态服务器
    Node.js脚手架express与前段通信【socket】
    临门一脚- Node.js
    redis缓存穿透和雪崩
    redis哨兵模式
    redis主从复制
    redis发布订阅
  • 原文地址:https://www.cnblogs.com/manmanlu/p/8318611.html
Copyright © 2011-2022 走看看