Rectangle
Rectangle 的基本用法
Rectangle 的基本用法import SwiftUI
struct ContentView: View {
var body: some View {
Rectangle()
.fill(Color.blue) // 填充颜色
.frame(width: 200, height: 100) // 设置宽度和高度
}
}Rectangle()
.stroke(Color.red, lineWidth: 5) // 添加红色边框,宽度为 5
.frame(width: 200, height: 100)属性和修饰符
其他功能
示例应用
总结
Last updated