Weird ViewController Problem

Discussion in 'iOS Development' started by hitman2992, Apr 12, 2010.

  1. hitman2992

    hitman2992 New Member

    Joined:
    Dec 10, 2007
    Messages:
    123
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    I call this to bring up my modalViewController view
    [objc][self.largeImageView setModalPresentationStyle:UIModalPresentationPageSheet];
    [self presentModalViewController:self.largeImageView animated:YES ];[/objc]

    and this to dismiss the view

    [objc][self dismissModalViewControllerAnimated:NO];[/objc]

    when I dismiss the view my navigation controller rotates for no apparent reason.

    heres a video
    http://www.youtube.com/watch?v=D5R3xuf9M6E
  2. Pelaez-1

    Pelaez-1 New Member

    Joined:
    May 5, 2008
    Messages:
    822
    Likes Received:
    0
    Device:
    iPhone
    I think the modal presentation style has to be set on the parent controller.
  3. hitman2992

    hitman2992 New Member

    Joined:
    Dec 10, 2007
    Messages:
    123
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    like this?

    [objc][self.parentViewController setModalPresentationStyle:UIModalPresentationPageSheet];[/objc]

    that doesn't work.
    if I do that it does not set the presentation style
  4. Pelaez-1

    Pelaez-1 New Member

    Joined:
    May 5, 2008
    Messages:
    822
    Likes Received:
    0
    Device:
    iPhone
    No. Like this.

    [objc][self setModalPresentationStyle:UIModalPresentationPageSheet];[/objc]

    With parent vc I meant the one that's gonna show the modal controller. Maybe I didn't make much sense. I apologize.
  5. hitman2992

    hitman2992 New Member

    Joined:
    Dec 10, 2007
    Messages:
    123
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    that fails to set the presentation style. You have to set it on the view that you are presenting.

Share This Page