UIScrollView does not work correctly after the Modal view controller is displayed in iOS 5.1

I have a strange problem when using the UIScrollView controller in conjunction with iPhone 4 and iOS 5.1.

I have a UIScrollView whose content size is 640x480 (dual screen efficiently), and in addition to the screen for switching between the two “screens”, I also allow the user to click on the screen, in response to which I call something like ...

[scrollView scrollRectToVisible:(CGRectMake 320,0,320,480) animated:YES];

the first 320 will be 0 if the tap occurred while the right side of the scroll view was displayed (note that paging is enabled in the scroll mode, so it can only go down completely or completely to the right).

I also have a situation where I sometimes show an additional view controller using modModalViewController, above this view controller containing a scroll.

Everything works fine until the modal view controller is presented and subsequently dismissed, after which the scrollRectToVisible method will no longer work if the animated value is set to YES (if I changed the animation to NO, then it works as expected). Note that the tap is still being registered and scrollRectToVisible is called, it just does nothing when the animated one is set to YES).

, iPhone 4 iOS 5.x.
( , ) : iPhone 3G 4.x, iPhone 3GS 3.x, iPod touch (2- ) 4.x , 5.x.

, ​​ , , , - iPhone 4 iOS 5.1.

- , ?

+3
3

. , modalViewController UIScrollerView 20px, , . , , UIViewController UIScrollView , UIScrollView , , .
viewDidLoad:

[[UIApplication sharedApplication] setStatusBarHidden:NO];

UIScrollView Y- 20px. .

0

, . ...

. , , .

iOS 5.x viewWillAppear, viewWillDisappear, viewDidAppear viewWillDisappear -, . , , .

, , iOS 5.x "", , viewWillAppear -, 5.x, 5.x - 5.x, 4.x .

5.x NSTimer, updateUI, , viewDidDisappear , , , NSTimers 5.x , 4.x.

NSTimers, , updateUI, , , scrollView . , , 5.x, Mac .

viewWillAppear , NSTimer , 4.x .

, Apple iOS ... , - .

+2

I finally managed to get this to work with iPhone4 running 5.1. Ensuring that the horizontal jump property for the scroll view is set eliminates the problem, although why this uncontrolled solution should cause the problem, first of all, outside of me - I'm quite sure that this is a bug in iOS.

0
source

All Articles