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

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

效果

41085-5bb27e1b91fb96f1.png
SwiftUI 高级使用Text之上下左右间隔

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

发布了637 篇原创文章 · 获赞 4 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/iCloudEnd/article/details/104068349