pradnya Gaikwad
pradnya Gaikwad

Reputation: 149

UIScrollview not scrolling smoothly

I have used scrollview and in that scrollview i have added text image now when i scroll the scrolling effect is not smooth it is either going up or down. The code i have used is:

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
}

Upvotes: 0

Views: 2488

Answers (1)

EmptyStack
EmptyStack

Reputation: 51374

pagingEnabled servers a different pupose. I guess you don't want paging here. So, pagingEnabled should be NO to make it scroll smooth.

mScrollView.pagingEnabled = NO;

Upvotes: 5

Related Questions