Hey, I am making a view based application. For one of the xib files, I want it to only appear in landscape mode. How do I do this?
Make sure the view's Orientation is set to Landscape:

Make sure that this function returns YES or (interfaceOrientation == UIInterfaceOrientationLandscape)
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
// Or you can use the following return statement:
//return (interfaceOrientation == UIInterfaceOrientationLandscape);
}
And in your Project-info.plist file in resource folder, there will be an option for "Support Interface orientation", set it according to your requirement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With