UITabBarController with UIScrollView. Scroll offse

2019-04-01 15:45发布

问题:

I have successfully created a TabBar with two ScrollView-tabs. However, if i scroll to the bottom in one tab and then switch tab and then switch back, my content seem to have disappeared upwards. If i try to scroll to the top i get stuck in the middle of the content but the scrollview thinks im at the top.

What i know so far:

contentView.frame.origin.y - (contentView is my view that resides in the ScrollView). If i print this variable when scrolling the first time i get 0 in every printout. I scroll to the bottom, switch tab, switch back: Now the print value is -453 in every printout.

I dont know what to do next. Please help me.