美文网首页SwiftUISwiftUI
SwiftUI 高级使用Text之上下左右间隔

SwiftUI 高级使用Text之上下左右间隔

作者: iCloudEnd | 来源:发表于2020-01-21 22:31 被阅读0次

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)
                
                
            }

效果

SwiftUI 高级使用Text之上下左右间隔

更多SwiftUI教程和代码关注专栏

相关文章

网友评论

    本文标题:SwiftUI 高级使用Text之上下左右间隔

    本文链接:https://www.haomeiwen.com/subject/ffkyzctx.html