Search code examples
iosobjective-cuiscrollviewcontentoffset

Why does the UIScrollView automatically change contentOffset?


Question Describe :

My App have 2 tabbar item . In the first Item , the viewcontroller have a view (the name is zpContainerView) ; a scrollView, it's zpContainerView's subView ; the scrollView add 3 subviews ;

Now , i touch the iphone's screen and change the scrollView's contentOffset ,

I click the second tabbar item , and soon after I click first tabbar item .

Question : Why does the scrollView automatically the contentOffset , why the contentOffset is CGPointZero ?

Please tell me why , and help me solve the question , thanks .


Solution

  • I have resolved the problem 。

    the ScrollView's class is not right .

    Please look this : " UIScrollView * scrollView = [[UITableView alloc] init] ; "