Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To Put XIB in Landscape

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?

like image 466
Marcus Avatar asked Nov 20 '25 08:11

Marcus


2 Answers

Make sure the view's Orientation is set to Landscape:
enter image description here

like image 170
Alexsander Akers Avatar answered Nov 21 '25 23:11

Alexsander Akers


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.

like image 23
Archana Chaurasia Avatar answered Nov 21 '25 22:11

Archana Chaurasia



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!