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

The Archive Base Latest Questions

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

In my application I have 2 views, portraitView and landScapeView. And also my application

  • 0

In my application I have 2 views, portraitView and landScapeView. And also my application consists of many views…

  1. When I launch the application both landscape and portrait view is getting displayed side by side.

  2. When I launch the application in landscapeview the portraitview is getting displayed..later after rotating and coming back the view is getting proper.

The code I am using is given below…so please suggest me what all changes should be done to overcome above problem as mentioned..

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

{ 

if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {  
    NSLog(@"LANDSCAPE>>");
    portraitView.hidden = YES;
    landscapeView.hidden = NO;

    UIColor *background = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"bg-ic_landscape.jpg"]];
    self.view.backgroundColor = background;



}
else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight){
    NSLog(@"LANDSCAPE<<");
    portraitView.hidden = YES;
    landscapeView.hidden = NO;
    UIColor *background = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"bg-ic_landscape.jpg"]];
    self.view.backgroundColor = background;

    self.view.hidden = NO;

}
else{
    portraitView.hidden = NO;
    landscapeView.hidden = YES;


    NSLog(@"Portrait");
    UIColor *background = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"bg-ic.jpg"]];
    self.view.backgroundColor = background;

    background = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"bg-ic2.jpg"]];
  self.view.backgroundColor = background;

}

return YES;
  • 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-26T08:02:38+00:00Added an answer on May 26, 2026 at 8:02 am

    It sounds like your portraitView and landscapeView are both visible on initial launch of the app. The code above is only executed when the orientation changes during runtime. If you do insist on using separate views for portrait and landscape then you’ll need to detect orientation at launch as well and show / hide the views appropriately.

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

Sidebar

Related Questions

i am doing application where i have taken two views Portrait and Landscape. i
In an MVC3 application I have a view rendering two Ajax partial views: a
I have an application with many views. I want only a couple of the
so, I created a Single View Application and I have 30 views in my
In my application I have few views with longer text. In my detail view
We have common views that we use in our application in many locations inside
We have a MVC3 application that we have created many small actions and views
In my MVC 2 application, I have many views with many, many input fields.
I have 2 Views in my MVC3 application. One View creates a cookie via
I have 3 views in my application. My first view (FIRST_VIEW) has 2 buttons

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.