how to make swift ui list images same sizes

Viewed 35

I have a list of images from the server, each image comes with diff size, however, I want to show the list of the images in the same dimensions, full width, height 300,

   GeometryReader { geo in
                       KFImage(URL(string: deal.vehicle!.images![0].imageUri!)!)
                           .resizable()
                          .scaledToFill()
                           .frame(width: geo.size.width,height: 300)
                           
                           .clipped()
                           
                   }.frame( height: 300)
                

that code is working however image takes more it is frame, by clicking on the search bar, the image receiving the click

 HStack {
        HStack {
            Image(systemName: "magnifyingglass")
                .padding(.leading, 10)
                .padding(.trailing, 3)

            TextField("Go on, give it a go!", text: $name)
        }
        .font(Font.system(size: 14))
        .padding(.vertical, 13)
        .background(Color.white)
        .cornerRadius(8)
        .padding(.trailing, 10)

        FilterdButton()

    }.padding(.horizontal, 20)
    .fixedSize(horizontal: false, vertical: true)
enter code here

mygold

0 Answers
Related