iphone - UIImagePickerController interfaceOrientation always come up as portrit -
i trying capture current orientation of uiimagepickercontroller being presented, , changing overlay view's hidden
property accordingly.
if([notification.name isequaltostring:@"uideviceorientationdidchangenotification"]) { uiinterfaceorientation orientation = self.cameraimagepicker.interfaceorientation; if(orientation == uiinterfaceorientationportrait) { self.cameraimagepicker.cameraoverlayview.hidden = no; } else { self.cameraimagepicker.cameraoverlayview.hidden = yes; } }
however, orientation == uiinterfaceorientationportrait
if rotate camera, method called every time device rotates.
note: application supports portrait orientation according project file, rotation somehow still supported uiimagepickercontroller
any issue appreciated!
after ios6, apple changed orientation api. can try method in appdelegate, hope can you.
- (nsuinteger)application:(uiapplication *)application supportedinterfaceorientationsforwindow:(uiwindow *)window { return uiinterfaceorientationmaskportrait; }
Comments
Post a Comment