UIScrollView Custom View rotation problem

Posted by Markus on Stack Overflow See other posts from Stack Overflow or by Markus
Published on 2010-05-31T14:18:43Z Indexed on 2010/05/31 14:23 UTC
Read the original article Hit count: 217

Filed under:
|
|

I have a ScrollView with a Custom View. Now i have the problem with the rotation, the view has after the rotation not the correct frame pos / size.

How can i call the CustomView after rotation for a reposition and resize the frame and content?!

- (void)setupPage
{
    NSUInteger nimages = 0;
    CGFloat cx = 0;
    for (; ; nimages++) {
        if (nimages == list.count) {
            break;
        }

        CustomStepView *stepView = [[CustomStepView alloc] initWithFrame:CGRectZero];
        stepView.tag = nimages;
        if([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortrait || [[UIDevice currentDevice] orientation] == UIDeviceOrientationPortraitUpsideDown) 
        {

            stepView.frame = CGRectMake(cx, 0.0 , 768.0f, 926.0f);
            cx += 768.0;
        }
        else
        {
            stepView.frame = CGRectMake(cx, 0.0 , 1024.0f, 670.0f);
            cx += 1024.0;
        }

        [scrollView addSubview:stepView];
        [stepView release];

    }

    self.pageControl.numberOfPages = nimages;

}

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about uiview