0

Apple的分页UIScrollView在大约 10000000 处有延迟,contentOffset.y如果我们将在大约 18900000 处进行部分滑动,请不要回到原始状态。contentOffset.y您可以使用以下代码创建简单的应用程序来检查它mainView

@implementation MainView

- (id) init
{
    self = [super init];

    if (self)
    {
        self.frame = [UIScreen mainScreen].bounds;
        UIScrollView *scroll = [UIScrollView new];
        scroll.frame = self.frame;
        scroll.contentSize = (CGSize){ CGRectGetWidth(self.bounds), 20000000.0 };
        scroll.contentOffset = (CGPoint){ 0.0, 18900000.0 };
        scroll.pagingEnabled = YES;
        scroll.backgroundColor = [UIColor greenColor];

        for (float i = 0; i < 20000000.0; i += 500.0)
        {
            UIView *line = [UIView new];
            line.backgroundColor = [UIColor redColor];
            line.frame = (CGRect){ 0, i, self.frame.size.width, 30.0 };
            [scroll addSubview:line];
        }

        [self addSubview:scroll];
    }

    return self;
}

@end

为什么会发生?有任何想法吗?

4

1 回答 1

0

It was fixed after reporting to the Apple Bug Reporter. In new versions of XCode you'll see that all is correct.

于 2014-08-13T14:45:53.200 回答