I want to make extendable list in scrollview. I use top of the scrollview global location but when I extend section top location decreased and relocated.
Example Code :
ScrollView{
VStack{
GeometryReader{ reader -> AnyView in
print("\(reader.frame(in: .global).minY)")
return AnyView(Text("\(reader.frame(in: .global).minY)").onTapGesture {
self.isExtended.toggle()
})
}
Text("Test").onTapGesture {
self.isExtended.toggle()
}
if isExtended{
ForEach(0..<10,id:\.self){ index in
Text("\(index)")
}
}
}
}
