如何使VStack中标签中的图像像List中的图像一样间距相等?
这里有一个例子。我想在标签中的每个图像采取相同的宽度间距,因为他们将在一个列表。
struct ContentView: View {
var body: some View {
VStack(alignment: .leading) {
Label("Hello, world!", systemImage: "globe")
Label("Hello, world!", systemImage: "bubble.left.and.bubble.right.fill")
Label("Hello, world!", systemImage: "bubble.right")
}
.padding()
}
}
1条答案
按热度按时间ikfrs5lh1#
您可以制作自己的
LabelStyle
,并确定标签的确切外观。使用方法: