0

When I scroll my LazyVGrid, app lags a lot.

 LazyVGrid(
   columns: [
       GridItem(.adaptive(minimum: horizontalSizeClass == .compact ? 160:320, maximum: 320), spacing: 16, alignment: .top)
   ],spacing: 16
  ){
     ForEach(viewModel.articles){ article in
         VStack{
           ArticleCardView(article: article, animation: animation, show: $show)
               .equatable()

ArticleCardView

VStack{
        if !show {
            HStack{
                Text(String(format: "%.2f €", article.rate1))
                    .fontWeight(.heavy)
                    .padding(.vertical, 5)
            }
            
            Image(uiImage: readImage(name: "\(article.id)00"))
                .resizable()
                .scaledToFit()

I made this view Equtable, but still lags. Scroll is not fluid.

Any idea to optimize scroll.

Dev
  • 1
  • 1

0 Answers0