开发者

Strange UIScrollView and NavigationController Problem

开发者 https://www.devze.com 2023-02-22 18:28 出处:网络
I\'ve run into a strange problem, i have few uiviewcontrollers which i\'m managing via navigationcontroller, each uiviewcontroller contains a uiscrollview with content in it.

I've run into a strange problem, i have few uiviewcontrollers which i'm managing via navigationcontroller, each uiviewcontroller contains a uiscrollview with content in it. Now, i push a viewcontroller into a navigation controller, say, Screen A, the uiscrollview does not scroll/bounce, A button on the scrollview of Screen A pushes Screen B 开发者_开发百科to the controller, and user pops back to screen A, the scrollview bounces!

Not sure why are my uiscrollviews are not able to bounce for the first time they are displayed, any clues?


Solved. Defined outlet in the code and set scrollview bounces property to true, and it works. Same property is however defined in the nib, still wondering why it didn't work on first load only.


Have a look at -(BOOL)viewWillAppear:(BOOL)animated method in the scrollview or where it is called in the parent view, is the delegate for the scrollview being properly assigned if so throw some logs in the - (void)scrollViewDidScroll:(UIScrollView *)scrollView and see what gets thrown back.

Also check where you are setting the content size for the scrollView, if at any stage the content size is less than the visible area, it wont scroll.

0

精彩评论

暂无评论...
验证码 换一张
取 消