Scarlaxx
Scarlaxx

Reputation: 835

Navigationbar resets content offset after taping back button

I have a bunch of scrolling views displayed by Navigationbar.PushViewController(...). When I show them these controls have their contentOffset set. The problem is that after tapping a back button in the navigationbar this offset is changed to Point 0,0 and after that it goes to the correct value. The setting to 0,0 causes my controls to load data while not required (offset was not changed by user). How can I avoid this 'temporary reset'of the offset?

Upvotes: 1

Views: 325

Answers (1)

jonathanpeppers
jonathanpeppers

Reputation: 26495

Have you tried storing the contentOffset in a variable in ViewWillDisappear? Then resetting contentOffset in ViewDidAppear?

I think the contentOffset functionality you are experiencing is a feature (ha ha) of UIKit.

Upvotes: 1

Related Questions