io6 allow interface orientation based on some condition
I have a flag and user will set it from setting. If set to No only
portrait orientation will be allowed. If flag is YES then both portrait as
well as landscape will be allowed. in ios 5 and below
-
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
//[image_signature setImage:[self resizeImage:image_signature.image]];
if(flag == YES)
return (toInterfaceOrientation ==
UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation ==
UIInterfaceOrientationLandscapeRight || toInterfaceOrientation ==
UIInterfaceOrientationPortrait);
else
return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
}
But in ios 6 and above above method deprecated. I was trying
-(BOOL)shouldAutorotate
- (NSUInteger)supportedInterfaceOrientations
But no success. Please help me.
No comments:
Post a Comment