Reputation: 3043
my paging scroll view is moving either horizontally and vertically and it should move only horizontally. I made an application which consists of 2 view the paging scroll view is a subview of one of them which frame is 320*400. my paging scroll view is 320*360 frame.i thought that it will move only horizontally. I pasted part of my code:
CGRect pagingScrollViewFrame = CGRectMake(0.0f, 0.0f, 320.0f, 480.0f);
pagingScrollView = [[UIScrollView alloc] initWithFrame:pagingScrollViewFrame];
pagingScrollView.pagingEnabled = YES;
pagingScrollView.backgroundColor = [UIColor blackColor];
pagingScrollView.showsVerticalScrollIndicator = NO;
pagingScrollView.showsHorizontalScrollIndicator = NO;
pagingScrollView.contentSize = [self contentSizeForPagingScrollView];
pagingScrollView.delegate = self;
self.view = pagingScrollView;
...
- (CGSize)contentSizeForPagingScrollView {
CGRect bounds = pagingScrollView.bounds;
return CGSizeMake(bounds.size.width * [self imageCount], bounds.size.height);
}
...
- (NSUInteger)imageCount {
static NSUInteger __count = NSNotFound;
if (__count == NSNotFound) {
__count = ([rootArray count]/5);
}
return __count;
}
thanks
Upvotes: 0
Views: 534
Reputation: 19869
Try to add
pagingScrollViewFrame.scrollsToTop=NO;
Hope it will help
Upvotes: 1