📜  在 SwiftUI 中使 VStack 填充屏幕的宽度 - Swift 代码示例

📅  最后修改于: 2022-03-11 15:00:57.993000             🧑  作者: Mango

代码示例1
struct ContentView : View {
        var body: some View {
            VStack(alignment: .leading) {
                Text("Hello World")
                    .font(.title)
                Text("Another")
                    .font(.body)
                Spacer()
            }
            .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .topLeading)
            .background(Color.red)
        }
    }