IPhone : How to present a modal view controller force in scape type?

on Sunday, April 19, 2015

I am using code as below, but it doesn't work.



- (BOOL)shouldAutorotate
{
return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationLandscapeRight;
}

-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
//return YES;
return UIInterfaceOrientationLandscapeRight;
}


I don't know why it does not work.


0 comments:

Post a Comment