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
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
Post a Comment