ios - CAShapeLayer dashed line start with margin
问题描述
Is it possible to start drawing dashed CAShapeLayer
line with some margin? I am connect couple dashed lines at an angle.
It would be great if my dash could start at half dash length. So if
lineDashPattern = [8, 8]
then dash line should start drawing with 4 margin
解决方案
You should use lineDashPhase. It specifies an offset, in user space applied to the line dash pattern
Line dash phase specifies how far into the dash pattern the line starts.
shapeLayer1.lineDashPhase = 8
推荐阅读
- java - java.lang.ClassCastException:Model.Film 无法转换为 java.util.List
- github - 尝试使用 GitHub Actions 将 Blazor 发布到 GitHub 页面
- jquery - flickity 只显示第一张图片
- docker - 无法连接到暴露端口上的 docker 映像
- google-chrome - D3.js Uncaught TypeError:...不是一个函数
- node.js - 在 DocuSign 中请求访问令牌 - Node.js
- coq - Type 产品的内射性有意义吗?
- linux - 使用 RDMA 的服务器上的客户端 IP 地址?
- types - 带标签的参数
- python-3.x - 用于映射 EPSG 的底图语法无效