ios - Orientation is not changed when view is changed from portrait to landscape -


i have menu portrait , detail view (with uiwebview) can portrait or landscape.

when enter detail view , rotate device landscape , go screen in way menu should portrait menu in landscape orientation (along status bar , navigation bar).

is there way avoid , force screen rotated desired (supported) orientation?

proposed solution @kkumpavat didn't worked me or wasn't clear enough me understand it. did more searching , found solution uses:

    // http://stackoverflow.com/questions/181780/is-there-a-documented-way-to-set-the-iphone-orientation     // http://openradar.appspot.com/radar?id=697     [[uidevice currentdevice] performselector:nsselectorfromstring(@"setorientation:")                                    withobject:uiinterfaceorientationportrait]; 

but generating annoying warnings , i've swapped with:

//force update of screen orientation if (self.interfaceorientation != [self preferredinterfaceorientationforpresentation]) {     [[uidevice currentdevice] setvalue:[nsnumber numberwithinteger: [self preferredinterfaceorientationforpresentation]]                                 forkey:@"orientation"]; } 

called navigationcontroller's viewdidappear.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -