Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8237709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:33:38+00:00 2026-06-07T19:33:38+00:00

Possible Duplicate: Landscape Mode ONLY for iPhone or iPad I’m making an iPad-only app

  • 0

Possible Duplicate:
Landscape Mode ONLY for iPhone or iPad

I’m making an iPad-only app that I want to be landscape only throughout the entire thing.

I’m very new to iOS programming and am using the StoryBoard method of creating the interface.

When I first set up the app, I selected a single view and click the buttons to make it be landscape only. I found out that only makes it start in landscape orientation but doesn’t prevent the user from manually rotating.

So, I found I had to do:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        if (interfaceOrientation == UIDeviceOrientationLandscapeLeft ||  interfaceOrientation ==  UIDeviceOrientationLandscapeRight) 
        {
           return YES;
        }
        return NO;
    }

in order to prevent the user from manually rotating it.

Now, I’ve created a Navigation Controller and a regular View that I set as the Root View Controller. I’ve also added a single button inside that view.

My problem is that my app seems to be landscape only at first startup (literally flashes landscape) but then is portrait only in what seems that navigation controller.

I’ve also found selected “Orientation: Landscape” for both the Navigation Controller and that first View Controller inside the Storyboard interface.

Even when I rotate the device to landscape, the app doesn’t rotate. It seems to be stuck in portrait even though all the settings are for landscape-only.

How can I make my app landscape-only instead of its current state of portrait-only?

EDIT: I actually found my own solution.

It appears as though my view that was linked to my Navigation Controller was not linked to the class file where I was setting the code for landscape only.

All I did was select the View Controller in the Storyboard interface, click the “Show Identity Inspector” button on the right sidebar and set the class as the name of my ViewController files where the code:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

was.

In short, my view controller wasn’t linked to the view controller class file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T19:33:39+00:00Added an answer on June 7, 2026 at 7:33 pm

    Returning YES and NO is not very recommended.

    Returning UIDeviceOrientationLandscapeLeft however should make your app “landscape only”:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    }
    

    If that don’t work, navigate to your Info.plist Info.plist file

    and add a Supported interface orientations row with Landscape (left home button) and Landscape (right home button).

    row's

    Additionally, I recommend to change the view(s) Orientation to Landscape in the
    Attributes Inspector.

    landscape

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Mobile site - force landscape only / no auto-rotate I have seen
Possible Duplicate: Check orientation on Android phone I am writing an app that requires
Possible Duplicate: How can I convert a list<> to a multi-dimensional array? I want
Possible Duplicate: How to do the vector of sets in C++? I want to
Possible Duplicate: check whether internet connection is available with C# I just want to
Possible Duplicate: Objective C for Windows iPhone development on Windows Is there any way
Is it possible to manipulate or duplicate the building data ( landscape.man_made ) for
Possible Duplicate: Transparent images with C# WinForms I am coding an app which will
Might be possible duplicate of :- iPad Application Comes Up in Portrait Orientation After
Possible Duplicate: Unload a module in Python After importing Numpy, lets say I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.