// 绘制圆形、矩形、圆角矩形、描边
struct ContentView: View {
var body: some View {
VStack {
Circle()
.fill(.orange)
.frame(width: 200,height: 200)
ZStack
{
Circle().fill(.purple)
Circle().fill(.yellow).scaleEffect(0.8)//缩小0.8倍
Circle().fill(.orange).scaleEffect(0.6)
}
Rectangle()
.fill(.orange)
.frame(width: 200,height: 200)
ZStack {
Rectangle().fill(.purple)
.frame(width: 300, height: 200)
Rectangle().fill(.yellow)
.frame(width: 300, height: 200)
.scaleEffect(0.8)
Rectangle().fill(.orange)
.frame(width: 300, height: 200)
.scaleEffect(0.6)
}
RoundedRectangle(cornerRadius: 120)//圆角矩形的半径
Rounde
SwiftUI初级课程(十九)绘制圆形、矩形、圆角、描边
最新推荐文章于 2024-08-02 13:35:44 发布