1

I wonder how to determine if the content inside ScrollView is fully visible without scrolling?

ScrollView {

 LazyVStack {
  PlainButton("1")
  PlainButton("2")
  PlainButton("3")
  PlainButton("4")
  PlainButton("5")
  PlainButton("6")
  PlainButton("7")
 }

}

I was going to use onAppear/onDisappear to tell if "1" and "7" are visible. Works for "1" as it's always visible from the very beginning... But if "7" is not visible - "onDisappear" event is not called right after load..

UPDATE: replaced VStack with LazyVStack

eugene_prg
  • 948
  • 2
  • 12
  • 25
  • Does this answer your question https://stackoverflow.com/a/62466397/12299030? – Asperi Jan 24 '21 at 18:46
  • Hi. Unfortunately, i have to use LazyVStack inside of my ScrollView , therefore it doesn't work. Is there any workaround for this case? – eugene_prg Jan 24 '21 at 19:05

0 Answers0