SwiftUI Shape 形状

89 阅读1分钟
Shape swiftUI中的几种形状
Circle 圆
Circle()

Simulator Screenshot - iPhone 16 - 2024-11-18 at 15.44.17.png

Ellipse 椭圆
Ellipse()

截屏2024-11-18 15.47.16.png

Rectangle 方形
Rectangle()

截屏2024-11-18 15.48.35.png

RoundedRectangle 圆角方形
RoundedRectangle(cornerRadius: 20.0).padding()

截屏2024-11-18 15.50.10.png

Capsule 胶囊形状
Capsule().padding()

截屏2024-11-18 15.52.36.png