HomeiOS DevelopmentHow do I prolong the background of kid views to their guardian...

How do I prolong the background of kid views to their guardian with out utilizing GeometryReader and with out affecting the pure peak in SwiftUI


As you’ll be able to see within the picture beneath, I need the left (star) and proper (solar) views’ backgrounds to fill their guardian (HStack) with out utilizing GeometryReader or altering the HStack’s pure peak.

How do I prolong the background of kid views to their guardian with out utilizing GeometryReader and with out affecting the pure peak in SwiftUI

struct FillParentTest: View {
    
    var physique: some View {
        HStack(spacing: .zero) {
            Picture(systemName: "star")
                .font(.title3)
                .padding()
                .background(.blue.opacity(0.5))
            
            Picture(systemName: "moon")
                .resizable()
                .body(width: 80, peak: 80)
                .padding()
                .body(maxWidth: .infinity)

            
            Picture(systemName: "solar.min")
                .font(.title3)
                .padding()
                .background(.pink.opacity(0.5))
        }
        .body(maxWidth: .infinity)
        .background(.yellow.opacity(0.5))
        .clipShape(.capsule)
        .padding(.horizontal)
    }
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments