Sunday, November 8, 2026
HomeiOS Developmentios - SwiftUI VStack - make the background fill all the display...

ios – SwiftUI VStack – make the background fill all the display in panorama

[ad_1]

The background would not fill all the display in panorama. How can I make it stretch all the best way?

White margins on the horizontal sides of the black background

This is my code:

import SwiftUI

struct ContentView: View {
    @Surroundings(.verticalSizeClass) var verticalSizeClass
    
    var physique: some View {
        VStack(spacing: 20) {
            VStack {
                Textual content("On the spot Developer")
                    .font(.system(.largeTitle))
                    .fontWeight(.daring)
                    .foregroundColor(.white)
                Textual content("Get assist from knowledgeable in quarter-hour")
                    .foregroundColor(.white)
            }
            
            HStack(alignment: .backside, spacing: 20) {
                Picture("pupil")
                    .resizable()
                    .scaledToFit()
                Picture("tutor")
                    .resizable()
                    .scaledToFit()
            }
            .padding(.horizontal, 50)
            
            Textual content("Need assistance with coding downside? Register!")
                .foregroundColor(.white)
            
            Spacer()
            
            if verticalSizeClass == .compact {
                HSignUpButtonGroup()
            } else {
                VSignUpButtonGroup()
            }
        }
        .padding(.prime, 30)
        .background(Coloration.black)
    }
}

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments