UITabBarController with UIScrollView. Scroll offset change when tab switch

家住魔仙堡 提交于 2020-01-13 06:26:46

问题


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.

来源:https://stackoverflow.com/questions/13630473/uitabbarcontroller-with-uiscrollview-scroll-offset-change-when-tab-switch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!