本文介绍了圆形文字按钮的制作过程
使用的技术
- 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教程与源码
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。