center content of scrollView
I’m trying to ensure the main item in an horizontal scrollView stays in the middle, however the below code only works when the view is loaded – in the following image you can see that with onAppear I get the item “Text 3” to be perfectly entered with the items by its side peeking out equally
SwiftUI – center content of scrollView
I’m trying to ensure the main item in an horizontal scrollView stays in the middle, however the below code only works when the view is loaded – in the following image you can see that with onAppear I get the item “Text 3” to be perfectly entered with the items by its side peeking out equally
SwiftUI – ScrollView scroll to specific ID with offset
I have ScrollView which is utilizing the ScrollReader to scroll to a view with a specific ID: