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

  • Home
  • SEARCH
  • 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 6326735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:08:50+00:00 2026-05-24T17:08:50+00:00

Possible Duplicate: iPhone orientation Depending on what orientation the iPad is in, I need

  • 0

Possible Duplicate:
iPhone orientation

Depending on what orientation the iPad is in, I need to either set the table view’s background or remove it because it doesn’t work with the popover.

I tried this but no luck:

if( [UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeLeft ){
    self.navigationController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]]; 
    self.tableView.backgroundColor = [UIColor clearColor];
    NSLog(@"test");

Maybe there is a better way? To see if table is master or popover, then set background?

  • 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-24T17:08:51+00:00Added an answer on May 24, 2026 at 5:08 pm

    There are several ways to achieve what you want, more or less:

    1. UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation];
    2. A more hack-ish method would be to check the width of the status bar.

    If you go with option 1, then you can check the orientation like so:

    switch (orientation) {
        case UIInterfaceOrientationPortrait:
            // Do something.
            break;
        case UIInterfaceOrientationPortraitUpsideDown:
            // Do something.
            break;
        case UIInterfaceOrientationLandscapeLeft:
            // Do something.
            break;
        case UIInterfaceOrientationLandscapeRight:
            // Do something.
            break;
    }
    

    EDIT: To get your application to automatically rotate, you can do this:

    - (BOOL)willAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        if ((interfaceOrientation == UIDeviceOrientationLandscapeRight)) NSLog(@"Right");
        if ((interfaceOrientation == UIDeviceOrientationLandscapeLeft)) NSLog(@"Left");
        if ((interfaceOrientation == UIDeviceOrientationPortrait)) NSLog(@"Up");
        if ((interfaceOrientation == UIDeviceOrientationPortraitUpsideDown)) NSLog(@"Down");
        return YES;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Merging existing iPhone and iPad app ids into a single universal app
Possible Duplicate: iPhone/iPad App Code Obfuscation - Is it Possible? Worth it? I have
Possible Duplicate: AppStore approval and md5 When developing iPhone or iPad apps and submitting
Possible Duplicate: Iphone sdk support for playing mp3 files over the network I need
Possible Duplicate: Is there an iPhone SDK API for twitter? i need to post
Possible Duplicate: Xcode - iPhone - profile doesn’t match any valid certificate-/private-key pair in
Possible Duplicate: iPhone SDK: Set Max Character length TextField I have 5 UITextFields, where
Possible Duplicate: Convert ipad application to iphone. Universal app I created one application which
Possible Duplicate: Best way to programmatically detect iPad/iPhone hardware How can I differentiate the
Possible Duplicate: Starting iPhone app development in Linux? Is there a way to use

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.