I have two UIScrollViews, one horizontal, one vertical, both two pages each (like horizontal - two pages wide, and vertical - two pages). Horizontal scrolling is vertical. I am trying to simulate a Calcbot design where you can scroll left / right buttons and up / down for a story.
However, when the image is loading, the horizontal scroll view is approximately 100 pixels higher than it should be. Then, when I touch him and start moving him a little, he jumps / moves to the correct position and stays there. How can I correctly display it from the very beginning?
Here is my code for viewDidLoad:
-(void)viewDidLoad {
horizontalScrollView.pagingEnabled = YES;
verticalScrollView.pagingEnabled = YES;
horizontalScrollView.contentSize = CGSizeMake(horizontalScrollView.bounds.size.width * 2, horizontalScrollView.bounds.size.height);
verticalScrollView.contentSize = CGSizeMake(verticalScrollView.bounds.size.width, verticalScrollView.bounds.size.height * 2);
horizontalScrollView.delegate = self;
verticalScrollView.delegate = self;
[verticalScrollView addSubview:horizontalScrollView];
[verticalScrollView setContentOffset:CGPointMake(0, 640)];
[self.view addSubview:verticalScrollView];
horizontalScrollView.frame = CGRectMake(0, 540, 320, 460);
}
Thank.
source
share