Help with view transition

Discussion in 'iOS Development' started by abotsch31, Jul 12, 2009.

  1. abotsch31

    abotsch31 Banned

    Joined:
    Feb 9, 2009
    Messages:
    31
    Likes Received:
    0
    I am wanting to add animation (flip to right) when I switch from view to view within my app.

    This is what I tried...

    [OBJC][UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1.5];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView

    Please Register or Log in to view images

    laceholder cache:YES];
    [view1 removeFromSuperview];
    [placeholder addSubview:view2];
    [view2 removeFromSuperview];
    [placeholder addSubview:view1];
    [UIView commitAnimations];[/OBJC]

    This wasn't really working for me. I can't figure out why. Does anyone know a way to make the view slide to the right and left instead of flip. Any help would be great.

    Thanks
    Abotsch31
  2. cocotutch

    cocotutch Community Development Team Staff Member

    Joined:
    Oct 6, 2008
    Messages:
    1,285
    Likes Received:
    117
    Device:
    5G iPod touch
    That code should be working perfectly to flip left/right to the next view, otherwise change
    Code:
    [placeholder addSubview:view2];
    to
    Code:
    [self addSubview:view2];
    if its the Main View on the screen which is doing the transitioning. Also the Slide from the Right belongs to Core Animation and you need to do something completely different, the best you can do with that is a Flip, Page Flip or Fade (I think thats all of them).

    cocotutch

Share This Page