SwiftUI 绘图之 绘制一组线段并动态添加Path (教程含源码)

实战需求

SwiftUI 绘图之 绘制一组线段并动态添加Path

本文价值与收获

看完本文后,您将能够作出下面的界面

截屏2020-09-04 下午10.17.28.png

Jietu20200904-221420.gif

看完本文您将掌握的技能

  • 掌握 Path 绘制线段
  • 掌握 for 循环基础使用
  • 掌握 stroke
stroke(Color.blue, style: StrokeStyle(lineWidth: 3, lineCap: .round, lineJoin: .round))

基础知识

stroke(style: StrokeStyle)

返回一个新的形状,该形状是self的描边副本,使用style的内容定义描边特征。

func stroke(style: StrokeStyle) ->

猜你喜欢

转载自blog.csdn.net/iCloudEnd/article/details/108412574