Home > Blockchain >  Blank screen appears in ScrollView if I update content inside ScrollView during scrolling - SwiftUI
Blank screen appears in ScrollView if I update content inside ScrollView during scrolling - SwiftUI

Time:05-24

Content of the scrollview will change based on users selection. For which I am having some shimmer view while loading data. If users scroll while updating the data, it shows white screen sometimes.

CodePudding user response:

I am not exactly sure how you structured your view. Your view might still be empty when the data is loading. There are 2 possible solution I can think of:

  1. Try to replace your stack with Lazy stack. For example LazyVStack, LazyHStack
  2. When data is loading, show a loading indicator on top of the view.

CodePudding user response:

Mostly, the UI exception happens when the content size doesn't match the content offset. For example, when you update the content height to a number what's smaller than current content Y offset.

  • Related