Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Make a VStack fill the width of the screen in SwiftUI

    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)
        }
    }
 
PREVIOUS NEXT
Tagged: #Make #VStack #fill #width #screen #SwiftUI
ADD COMMENT
Topic
Name
5+1 =