UIScrollview不能顺利滚动

时间:2011-06-28 13:03:09

标签: iphone objective-c ios

我已经使用了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
}

1 个答案:

答案 0 :(得分:5)

pagingEnabled服务器有不同的用途。我猜你不想在这里分页。因此,pagingEnabled应为NO,以使其滚动顺畅。

mScrollView.pagingEnabled = NO;