문제

Paging of UIScrollView by Apple has delay at contentOffset.y about 10000000, and don't come back in the origin state if we will do partial swipe at contentOffset.y about 18900000. You can check it creating simple app with the code of 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

Why it's happen? Any ideas?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top