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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:35:52+00:00 2026-06-08T06:35:52+00:00

So I wanted to add a UIViewController with width 450 and height of the

  • 0

So I wanted to add a UIViewController with width 450 and height of the screen, so if it’s portrait then the height is 1024 and if it’s landscape then the height is 768. This view controller, called ProfileViewController has a xib that is set at 450 and 1024. Auto-resize is set to have flexible height.

 profViewController = [[ProfileViewController alloc] initWithNibName:@"ProfileViewController" bundle:nil];
            self.profileViewController_ = profViewController;
            [profViewController release];

So inside ProfileViewController I am also initializing another view controller called FeedsViewController. Now the issue is that in profViewController viewDidLoad’s the height is always set to 1024 no matter what the orientation is. How do I have this so that it adjusts to what my orientation is? I’ve tried setting the bounds of profViewController but then this change is reflected after the viewDidLoad.

  • 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-08T06:35:54+00:00Added an answer on June 8, 2026 at 6:35 am

    If you set the FeedsViewController view’s frame in the same manner that you’ve set the ProfileViewController view’s frame in the NIB, then things should automatically resize correctly. That is, you give it an initial size that’s what you want relative to the outer view, then let the system’s auto-resize behaviour take things from there.

    Try something like this inside ProfileViewController‘s viewDidLoad:

    // create and init self.feedsViewController
    // ...
    
    CGRect b = self.view.bounds;
    self.feedsViewController.view.frame = CGRectMake((b.size.width - 450) / 2, 0, 450, b.size.height);
    self.feedsViewController.view.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I wanted to add two natural numbers together that are more then 150
Found this at MDC but how if I'd wanted to add a private variable
In continuation of the question at this link I wanted to add some functionality
just wanted to add this Color Picker ( http://code.google.com/p/devmil-android-color-picker/source/browse/ ) to my app and
Hi I wanted to add a delay on my splash screen using a Async
I wanted to add Scroll view to my UIimage views which are created dynamically
I wanted to add a JSP to my project and I think this is
I wanted to add crash reporting capabilities to my iPhone app. Kind of the
I wanted to add a new property to one of my model (table). Basically
I wanted to add a StackOverflow-style tag input to a blog model of mine.

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.