Transitions

Discussion in 'iOS Development' started by ipodmail09, Sep 19, 2009.

  1. ipodmail09

    ipodmail09 Member

    Joined:
    Mar 13, 2009
    Messages:
    269
    Likes Received:
    0
    Device:
    2G iPod touch
    Ok i want to change the way that the iphone loads/changes the page.

    here is the code:

    [OBJC]#import "EffectsViewController.h"
    #import "SecondViewController.h"

    @implementation EffectsViewController

    -(IBAction)tap

    Please Register or Log in to view images

    id)sender
    {
    SecondViewController *One = [[SecondViewController alloc] initWithNibName:nil bundle:nil];
    [self presentModalViewController:One animated:YES];

    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:2];
    [UIView setAnimationTransition:101 forView:self.view cache:NO];
    [UIView commitAnimations];

    }[/OBJC]

    The bottom four lines are the transition code,but the code above it [load new page] is stopping the transition to work any idea on how they can work together.

    Thanks Ipodmail.
  2. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
  3. ipodmail09

    ipodmail09 Member

    Joined:
    Mar 13, 2009
    Messages:
    269
    Likes Received:
    0
    Device:
    2G iPod touch
    looked and tryed it with no luck thanks
  4. Axis

    Axis Super Moderator Staff Member

    Joined:
    Dec 2, 2007
    Messages:
    6,288
    Likes Received:
    133
    Device:
    iPhone 4S (White)
    Do you know what a modal view is?
  5. ipodmail09

    ipodmail09 Member

    Joined:
    Mar 13, 2009
    Messages:
    269
    Likes Received:
    0
    Device:
    2G iPod touch
    I wont the modal view be joined with the view transition
  6. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    Try harder.
  7. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    You have a bad case of Takingcodeandusingitwithoutlookingit-itis. To solve your problem, actually take a good hard look at what you have written. Specifically this line:
    [self presentModalViewController:One animated:YES];

    What you're doing is telling the frameworks that you want the view controller to appear using its own animation. You're telling UIKit to present the view controller and animate it itself.

    Your options are:
    • override UIViewController's -presentModalViewController and -dismassModalViewController methods,making sure to add/remove the controller from the stack appropriately, and animating how you see fit.
    • Don't present this as a modal view controller. Just add the viewController.view as a subview. To quote Apple's documentation re modal view controllers:
    • Take that above method, and change animated to NO.

Share This Page