views:

378

answers:

1

I have a modal view that is presented and dismissed fine when my device is in vertical orientation. I have problems when my modal view is presented in the vertical orientation, but dismissed in horizontal orientation. The entire app switches back to vertical orientation automatically. How can I ensure that if I am in horizontal orientation, the view should dismiss properly?

A: 

I assume that what you mean by "presented in the vertical orientation, but dismissed in horizontal orientation" is you rotate the device when the modal view controller is shown.

In this case, you need to also rotate the "parentViewController", while the modal view controller is shown. You have to implement the view controller rotation methods, and inside the implementation, you have to make sure that the parent view controller is sent this messages / methods too.

You need to maintain orientation consistency in the view hierarchy.

Jesse Armand