Post

Replies

Boosts

Views

Activity

Reply to ScrollViewReader's scrollTo may be broken on iOS 15
In my case, LazyVStack helped to fix the scrollTo issue struct ContentView: View {  var body: some View {   ScrollViewReader { proxy in    ScrollView {     VStack {      Color.yellow       .frame(height: 800)      ScrollButton(proxy: proxy)     }    }   }  } } struct ScrollButton: View {  let proxy: ScrollViewProxy  @Namespace var bottomId  var body: some View {   LazyVStack {    Button("Scroll") {     withAnimation {      proxy.scrollTo(bottomId)     }    }    Color.red     .frame(height: 500)     .id(bottomId)   }  } } struct ContentView_Previews: PreviewProvider {  static var previews: some View {   ContentView()  } }
Oct ’21