views:

59

answers:

1
-(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

A: 

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.

Echelon
as i know viewDidLoad makes additional setup after loading the view. it says so in the commented part of the application.Never the less I tried that to and it does the same thing
Spire
It seems a little strange you have the addSubview inside the animation block too. That probably means your viewDidLoad is still called inside the animation block. If you put addSubview before the beginAnimations line, does it make a difference?
Echelon
Oh man that's it thanx a lot
Spire