SwiftUI 基础之圆形文字按钮ZStack Button Circle(2020)
文章目录
本文介绍了圆形文字按钮的制作过程
使用的技术
- 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教程与源码
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论