ios - Locking orientation issue in iphone -


i have structure this

loginviewcontroller-->root  loginviewcontroller-->uinav---->homeviewcontroller 

now have lock orientation portrait iphone , have provide both orientations ipad

for login controller, wrote this

-(bool)shouldautorotate{      if(ui_user_interface_idiom()==uiuserinterfaceidiompad)     {         return yes;     }     else     {     return no;     } } 

this working fine. got portrait orientation in iphone , both portrait landscape orientation in ipad

but same piece of code written in homeviewcontroller not working. due navigation controller embedded homeviewconroller.

well. got fix myself. posting solution on might others too. uncheck device orientation checks (landscapeleft , landscaperight) in target->general

enter image description here

and write same piece of code in every controller

-(bool)shouldautorotate{      if(ui_user_interface_idiom()==uiuserinterfaceidiompad)     {         return yes;     }     else     {         return no;     } } 

this worked me. portrait mode in iphone , landscape portrait mode in ipad.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -