嗨,我有一个问题,我的分页滚动视图移动horizontaly和垂直,它应该只移动horizontaly。我做了一个应用程序,其中包括2查看分页滚动视图是其中一个框架是320 * 400的子视图。我的传呼滚动视图是320个* 360 frame.i认为这将仅移动horizontaly.i贴上我的代码一些部分:寻呼滚动查看移动垂直到
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;
}
感谢
这是一个可可触摸(iOS)或可可(Mac OS X)的问题?你使用了Cocoa标签,但是UIKit在Mac OS X上不可用,所以我认为这是一个iOS问题。请重新登录。 – Robin 2011-04-05 06:42:13
对不起我的错误可可触摸 – Csabi 2011-04-05 06:44:19