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 6948513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:49:59+00:00 2026-05-27T13:49:59+00:00

I have an iPhone app that supports all device orientations, but I have a

  • 0

I have an iPhone app that supports all device orientations, but I have a specific modal view that I only want to display in landscape.

If the device is in landscape orientation it works fine, but if the device is physically held in portrait orientation it does not display the way I would like.

Because the device is held in a portrait orientation the image is cropped and the left and right sides are off the edges of the display. Since the image is only as high as the narrow dimension, the top and bottom shows the background of the parent view. If I then rotate the device into a landscape orientation everything is then fine.

In my research I frequently come across shouldAutorotateToInterfaceOrientation, but I believe that is an event that only gets fired when the device is physically rotated which does not apply to my situation. The device is physically held in portrait orientation but I want to display the view as if it was held in landscape.

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight] is also mentioned but I have never seen that have any effect when I’ve tried using it.

So I guess my question is if there is a simple way to force the initial display of a view in an orientation different than the physical orientation of the device and exactly how to do it.

I am using the following logic to modally display my view:

    TitleViewController *titleController = [[TitleViewController alloc] initWithNibName:@"TitleViewController" bundle:[NSBundle mainBundle]];
    titleController.delegate = self;
    titleController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    [self presentModalViewController:titleController animated:YES];
    [titleController release];

I want to always display the modal view in a landscape orientation, even when the device is held in portrait.

UPDATE

Found a solution that works:

    if (self.interfaceOrientation == UIInterfaceOrientationPortrait)
    {
        self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(90));
        self.view.bounds = CGRectMake(0.0, 0.0, 480, 320);
    }

However, when dealing with the orientation UIInterfaceOrientationPortraitUpsideDown, it initially displays the view with the proper orientation but then shifts it back to a portrait orientation with clipped sides and shows the background above and below the image.

I have tried tweaking the angle to 270, -90, and other values but always reverts to portrait when in the UIInterfaceOrientationPortraitUpsideDown orientation.

Why?

  • 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-05-27T13:49:59+00:00Added an answer on May 27, 2026 at 1:49 pm

    This approach did everything I needed:

        if (self.interfaceOrientation == UIInterfaceOrientationPortrait)
        {
            self.view.transform = CGAffineTransformMakeRotation(degreesToRadians(90));
            self.view.bounds = CGRectMake(0.0, 0.0, 480, 320);
        }
    
        TitleViewController *titleController = [[TitleViewController alloc] initWithNibName:@"TitleViewController" bundle:[NSBundle mainBundle]];
        titleController.delegate = self;
        titleController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
        [self presentModalViewController:titleController animated:YES];
        [titleController release];
    

    Rotate the orientation before presenting my modal view.

    And I just removed support for UIInterfaceOrientationPortraitUpsideDown since that orientation wasn’t needed.

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

Sidebar

Related Questions

I have an app for iPhone on app store that supports all versions from
I have an iPhone app that shows a simple view (View 1) that has
I'm developing an iPhone/iPad app that supports dragging items between table views. Since all
Hi I have an app that supports iOS 3 however I've only ever tested
I have a universal app which supports both orientations and all resolutions, so there
I have an iPhone app that I've built for the app store. Before I
I have an iPhone app that I am writing and it has 2 targets
I have an iPhone app that allows users to record videos and I'd like
I have an iPhone app that heavily relies on the OpenCV library; as such,
I have an iPhone app that is based on a navigation controller. I have

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.