Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top