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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:39:26+00:00 2026-05-24T08:39:26+00:00

I have a background image in UIViewController and RootViewController. I have added both viewController’s

  • 0

I have a background image in UIViewController and RootViewController. I have added both viewController’s View inside window as follows

        MainMenuBavkGround_ipad *backImage = [[MainMenuBavkGround_ipad alloc] initWithNibName:@"MainMenuBavkGround_ipad" bundle:[NSBundle mainBundle]];
    RootViewController *rootviewController = (RootViewController *)[navigationController.viewControllers objectAtIndex:0];
    backImage.m_rootViewController = rootviewController;
    rootviewController._buttons = Buttons;
    rootviewController.tableView.contentInset = UIEdgeInsetsMake(250.0, 200.0, 0.0, 0.0);
    rootviewController.view.backgroundColor = [UIColor clearColor];
    [window addSubview:navigationController.view];
    [window addSubview:backImage.view];

But now UIViewController (MainMenuBavkGround_ipad) is not changing its orientation. even it does not calls shouldAutorotateToInterfaceOrientation.

If i reverse order of adding views in window then RootViewController’s view is not changing orientation.

and if i add UIViewControoler’s view on window and add RootViewController’s view on UIViewController’s view then viewDidAppear of rootViewController does not invoke.

I tried calling shouldAutorotateToInterfaceOrientation manually. but it does not worked.

Can anybody tell me how to do this?

  • 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-24T08:39:27+00:00Added an answer on May 24, 2026 at 8:39 am

    Solved Problem!!!!!!

    By documentation I got that i can not add two viewcontroller’s views in window. So what I tried is i searched for how to set tableview background; and i got a post by user ama269 and then I set my window background color to the image by following code.

     window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"scrn_01_iPad.png"]];
    

    and whenever my view get orientation notification i do following to change the differnet orientation image.

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {;
    if( (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad))
    {
        if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||interfaceOrientation == UIInterfaceOrientationLandscapeRight )
        {
            self.parentViewController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"1st_scrn_iPad_L.png"]];
        }
        else
        {
            self.parentViewController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"scrn_01_iPad.png"]];
    
        }
    }
    

    }

    And then my problem is solved now viewDidAppear of rootViewController get invoke. and my image orientations also get handled.

    Thanks to ama269

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

Sidebar

Related Questions

I have background image for a site header with fixed width. Now I am
I have setup background image for a button as below. // declarations globally declared...
Ok so I have a Background background-image: url('images/body.png'); now I want to overlay a
I have a tiling background image, but I want to overlay another tiling image
My scenario: I have one color background image JPG. I have one black text
I have a iframe on my page. I have inserted a background image on
I have given a table background image using css background-image property. The cells are
I have a page that uses a background image to do rounded corners, and
i have the following script css: img { background-image:url(man.png); background-repeat:no-repeat; padding-top:6px; padding-bottom:60px; padding-left:10px; padding-right:10px;
I have a container (div) with a background image. In this div there is

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.