SwiftUI 高级使用Text之上下左右间隔
代码
设置top,leading,bottom,trailing
.padding(EdgeInsets(top: 16, leading: 10, bottom: 0, trailing: 5))
完整代码
VStack(alignment: .leading, spacing: 20){
Text(mingHua.name)
.foregroundColor(.steam_gold)
.bold()
.font(.system(size: 20))
.padding(EdgeInsets(top: 16, leading: 10, bottom: 0, trailing: 5))
Text(mingHua.overview)
.font(.system(size: 16))
.foregroundColor(.gray)
}