I need a view that can display both in Portrait and landscape.But when I load another view I only want it show in landscape.
I have a view controller A.which can be shown in portrait and landscape.This view controller is create by the App delegate.
When I click a button on the view A.I create a view controller B which I want to display only in landscape.and load the view like [A.view addSubView:B.view].
When I rotate the device the function shouldAutorotateToInterfaceOrientation is called only in
controller A. No matter how I set the function in controller B.It can’t be called.
On your first view, make sure that
And in your second view set it to
Update:
Ok, try this…
In your main view controller/app delegate, where the shouldAutorotateToInterfaceOrientation is run every time the device rotates, put a global level variable. something like