I am working on an app, where app is required to auto-rotate in Ipad only(ie Landscape and the Potrait mode), which am able to achieve. But the Iphone one is not required to rotate(ie potarit mode only). I tried almost every code available on stackoverflow. but no success. I tried following
(NSUInteger)supportedInterfaceOrientations
and
(BOOL)shouldAutorotate
but no success. I am also using NVSlider(a third party) for the slide bar. I wrote the code in that file also, as it was too having some orientation related methods, but no result
Well I got the answer. as I was building a Universal app, I was provided with some option. See the images and we can set orientation for IPad and Iphone seprately.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
{
return interfaceOrientation == UIInterfaceOrientationPortrait;
}
return YES;}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.