我已经使用了scrollview,在滚动视图中我已经添加了文本图像,当我滚动滚动效果不顺畅它要么是向上还是向下。 我使用的代码是:
mScrollView.delegate = self;
//mScrollView.showsHorizontalScrollIndicator = FALSE;
[mScrollView setFrame:CGRectMake(0, 10, 1024, 768)];
// a page is the width of the scroll view
mScrollView.pagingEnabled = YES;
mScrollView.scrollsToTop = NO;
[mScrollView addSubview:mImgView];
// setting image according to the tag
if ( mTag == 0 )
{
[mBckImgView setImage:[self getImageFromName:@"ombgiphone"]];
[mImgView setFrame:CGRectMake(0, 10, 320, 1063)];
mImgView.image = [self getImageFromName:@"introtextiphone"];
[mScrollView setContentSize:CGSizeMake(320, 1400)];// size of the image
}
答案 0 :(得分:5)
pagingEnabled
服务器有不同的用途。我猜你不想在这里分页。因此,pagingEnabled
应为NO
,以使其滚动顺畅。
mScrollView.pagingEnabled = NO;