Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS trigger orientation change event

I have 2 UIViews. The first supports only portrait. The second both portrait and landscape. To achieve that i change the return value of supportedInterfaceOrientations so that it gives the right orientations depending on what view i am.

When i change from screen 2 to screen 1 the view remains in a buggy landscape form, however when i rotate the device the View actually rotates to portrait and is locked there correctly. The reason for that is that when i rotate the device a rotation change event will be triggered.

my question: Is there a way to programmatically trigger a orientation change event?

like image 854
user2462592 Avatar asked Mar 24 '26 01:03

user2462592


1 Answers

I believe what you're looking for is preferredInterfaceOrientationForPresentation on view 1:

 - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
 {
     return UIInterfaceOrientationPortrait;
 }
like image 130
Stakenborg Avatar answered Mar 25 '26 14:03

Stakenborg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!