Saturday, November 21, 2026
HomeiOS Developmentios - SwiftUI - Challenge with Textual content not filling out first...

ios – SwiftUI – Challenge with Textual content not filling out first line

[ad_1]

How do I forestall my textual content from being mechanically displayed on two traces, as an alternative of fill out the primary line to the top, first. Is that this a bug? Any ideas drastically appreciated.

Anticipating answer:

enter image description here

That is what I get:

enter image description here


import SwiftUI

struct ContentView: View {
    var physique: some View {
        VStack {
            HStack(spacing: 18) {
                
                VStack {
                    Textual content("Want so as to add a whole sentence.")
                        .font(.subheadline)
                        .body(maxWidth: .infinity, alignment: .main)
                }
                .body(minWidth: 0, maxWidth: .infinity)
                .background(Colour.inexperienced)
                
                VStack {
                    Textual content("Want so as to add a whole sentence.")
                        .font(.subheadline)
                }
                .body(minWidth: 0, maxWidth: .infinity, alignment: .main)
                .background(Colour.grey)
                
            }
            .body(minWidth: 0, maxWidth: .infinity)
            .background(Colour.yellow)
            .padding()
            
        }.edgesIgnoringSafeArea(.all)
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments