Friday, May 24, 2024
HomeiOS Developmentios - Swift: How do I align my picture and the textbox...

ios – Swift: How do I align my picture and the textbox under?


I’m making an attempt to align a picture with a textbox in a Swift software.
How do I get this to look right?

That is the model of code I’ve that’s funky. I’ve tried lots of issues and I need assistance, please.

ForEach(itemizing.gadgets, id: .self) { i in
                VStack(alignment: .main, spacing: 6) {
                    Picture(i.itemImageUrl)
                        .resizable()
                        .scaledToFit()
                        .overlay(
                            ZStack {
                                Textual content("$ (i.priceOfItem)")
                                    .font(.physique)
                                    .padding(5)
                                    .foregroundColor(.white)
                            }
                                .background(Coloration.black)
                                .opacity(0.7)
                                .cornerRadius(12)
                                .padding(10),
                            alignment: .bottomTrailing)
                   
                        Textual content("Description: (i.itemDescription)")
                        .body(width: .infinity, alignment: .topLeading).padding(8)
                            .background(Coloration.grey.opacity(0.2))
                            .font(.physique)
                }
                .padding()

enter picture description right here

I’m aiming for the alignment on the left, however when the code renders inside one other view there is a bizarre white house.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments