Pergunta

I have struggled to find a solution with the many similar questions and answers so I'm going to post my project here

My code does the following: 1) Creates a "container" view controller which is actually a scrolling view with 3 pages (left page, middle page, right page). 2) I just coloured the pages so you can tell the difference 3) The middle page has a view controller attached to it which contains a button 4) Pressing the button on the middle page will display a UITableViewController 5) Tapping the "Done" button should dismiss the UITableViewController

In portrait mode, no problems can be seen. In landscape mode, the UITableViewController pops up just fine with the correct (landscape also) orientation. However, when popViewController is called, this seems to make the device think that it is is portrait mode, so it rotates the tableview to portrait mode prior to the disappearing animation.

My view controller with the button is then also messed up because of this portrait change. If I rotate the device again, it returns back to normal.

This is a problem on both iPod and the iPhone 6.1 simulator for me.

Can somebody please have a look at my code and tell me what I'm doing wrong? (Big ask, I know, but hopefully that will also help somebody else out).

Thanks

Foi útil?

Solução

I found the solution according to Apple's documentaton. If I create a separate portrait VC and landscape VC - as per the AlernateViews sample, it works correctly.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top