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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:09:11+00:00 2026-06-06T08:09:11+00:00

My view is originally in landscape mode. when a button is taped, a view

  • 0

My view is originally in landscape mode. when a button is taped, a view opens in portrait mode and everything is find upto this point. the problem is when I go back from that view to the root view the view won’t rotate correctly. here is the code I use to rotate the view from portrait to landscape,

-(void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];

//rotate the page to lansscape
CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation(-90*0.0174532925);
landscapeTransform = CGAffineTransformTranslate (landscapeTransform, 0.0, 0.0);

[self.navigationController.view setTransform:landscapeTransform];

self.navigationController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth |UIViewAutoresizingFlexibleHeight;    
self.navigationController.view.frame  = CGRectMake(0.0, 0.0, self.view.frame.size.width, self.view.frame.size.height);
self.navigationController.view.center  = CGPointMake (384.0, 544.0);

[UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeLeft;
}

here is a screen shot of the root page in landscape mode after returning from the portrait page,

enter image description here

this is how it should look like

enter image description here

  • 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-06T08:09:13+00:00Added an answer on June 6, 2026 at 8:09 am
    -(void)viewWillDisappear:(BOOL)animated
    {
    
    [super viewWillDisappear:animated];
    
    //rotate the page to lansscape
    CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation(-90*0.0174532925);
    landscapeTransform = CGAffineTransformTranslate (landscapeTransform, 0.0, 0.0);
    
    [self.navigationController.view setTransform:landscapeTransform];
    
    self.navigationController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth |UIViewAutoresizingFlexibleHeight;    
    self.navigationController.view.frame  = CGRectMake(0.0, 0.0, self.view.frame.size.width, self.view.frame.size.height+64);
    self.navigationController.view.center  = CGPointMake (384.0, 512.0);
    
    [UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeLeft;
    
    }
    

    the thing that i had to play around to adjust the landscape view that was appearing after this view that is in portrait mode disappears was this,

    self.navigationController.view.frame  = CGRectMake(0.0, 0.0, self.view.frame.size.width, self.view.frame.size.height+64);
    self.navigationController.view.center  = CGPointMake (384.0, 512.0);
    

    I played around with the center point and the frame height to adjust it.

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

Sidebar

Related Questions

NEW EDIT: I have narrowed my problem to this - i have a view
I want to create a view controller that supports both landscape and portrait orientations,
So originally I had a structure like this in my video view: <% @video.comment_titles.each
I have a table view. I originally used the cell's textLabel to handle this,
View Looks Like This <?=form_open_multipart('upload/process');?> <input type=file multiple=multiple name=userfile[] id=userfile /> <?=form_submit('upload', 'Upload');?> <?=form_close();?>
public View getView(int position, View convertView, ViewGroup parent) { Button btn; if (convertView ==
I have this view and I do some rotation transformation to it using something
This question was originally using MySQL 5.1.44, but is applicable to MySQL 8.0+ too.
I have a Seam application originally generated by seam-gen with a view Search.xhtml. Search.xhtml
I originally created an editor template like this @model MyModel var items = //

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.