原文链接:https://github.com/fzhlee/SwiftUI-Guide#-%E7%AC%AC3%E8%8A%82vstack-
VStack视图可以使其子视图,在垂直方向上进行等距排列。
示例代码:
struct ContentView : View {
var body: some View {
VStack{
Text("The fruit and the tree")
.font(.largeTitle)
Image("Apple")
Text("An apple is a sweet, edible fruit produced by an apple tree Apple trees are cultivated worldwide and are the most widely grown species in the genus Malus.")
.font(.body)
.lineLimit(nil)
.frame(height: 200)
}.padding()
}
}
网友评论