gpt4 book ai didi

iphone - UIScrollview 滚动不流畅

转载 作者:行者123 更新时间:2023-11-28 18:44:30 27 4
gpt4 key购买 nike

我已经使用了 scrollview,并且在那个 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
}

最佳答案

pagingEnabled 服务于不同的目的。我猜你不想在这里传呼。因此,pagingEnabled 应该是 NO 以使其平滑滚动。

mScrollView.pagingEnabled = NO;

关于iphone - UIScrollview 滚动不流畅,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6506857/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com