문제

-(void)CallingView2{

    SettingsViewController *aSettingsView = [[SettingsViewController alloc] initWithNibName:@"Settings" bundle:nil];

    [self setSettingsViewController:aSettingsView];
    [aSettingsView release];

    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1.0];
    //setting the animation
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:window cache:YES];
    [self.window addSubview:[settingsViewController view]];
    **[[settingsViewController view] setBounds:CGRectMake(0, -30, 320, 480)];**

    [UIView commitAnimations];}

I have put the code between the stars in the code where I commit my animation and it works, it moves the view as it should but now the problem is that when i rotate to the view i can see when the view is moving down. Is it possible to set bounds for the view before it is shown so the user cant see when it is moving 30px down every time he go to settings

도움이 되었습니까?

해결책

Your problem is that you're setting the view bounds within an animation block. The view origin will animate from (0,0) to (0,-30) during the time it takes to perform the flip transition.

Setting your view geometry in the view controller's viewDidLoad would be a better approach.

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