2011-06-28 186 views
0

我已經使用scrollview,並在該scrollview我現在添加文本圖像時,當我滾動滾動效果不光滑它要麼上漲或下跌。 我已經使用的代碼是:UIScrollview不能平滑滾動

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;