本文介绍了圆形文字按钮的制作过程 使用的技术
- ZStack
- Button
- Circle()
- Text
代码
import SwiftUI
struct ContentView: View {
var body: some View {
Button(action: {
}){
ZStack{
Circle()
.frame(width: 100, height: 100)
.foregroundColor(.blue)
Text("Press me")
.foregroundColor(.white)
}
}
}
}
效果

更多SwiftUI教程和代码关注专栏
- 请关注我的专栏icloudend, SwiftUI教程与源码