Sheehan Alam
Sheehan Alam

Reputation: 60889

Modal View Does Not Appear in Center in Horizontal Orientation

I have a UIPresentationFormSheet (contains a textview) that appears in the center of the screen when I am in vertical orientation. When I dismiss the modal view, it disappears fine.

When I am in horizontal orientation my modal view does not appear in the center of the screen. I have to dismiss my keyboard for the modal view to appear in the center.

[self presentModalViewController:composeTweetController animated:TRUE];

When I dismiss the modal view in horizontal orientation the app automatically switches to vertical orientation.

-(void)dismissComposeTweetView{
    [self dismissModalViewControllerAnimated:TRUE];
}

The modal view controller supports horizontal orientation:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}

I want the following to happen:

  1. Modal view should appear in the center in horizontal orientation
  2. Modal view should disappear without switching to vertical orientation

Upvotes: 0

Views: 772

Answers (1)

Kristopher Johnson
Kristopher Johnson

Reputation: 82535

Does the modal view controller have an appropriate override of shouldAutorotateToInterfaceOrientation:?

Upvotes: 1

Related Questions