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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:10:43+00:00 2026-05-17T23:10:43+00:00

In interface builder I have created a UIVIew (the view of a UIViewController) containing

  • 0

In interface builder I have created a UIVIew (the view of a UIViewController) containing a UIScrollView. The UIScrollView is set up in a way that it will resize depending on the orientation of the iPad.

When I launch the application in portrait mode, the view initially has a width and height of the portrait orientation. It is only after I start interacting with the app that the view suddenly adjusts to the “correct” orientation.

Basically, my question is why the frame and bounds of the UIScrollView (and the UIView for that matter) remain as if the device was in portrait mode? I have seen several threads on the net about this, but none of them really gave me the answer I am looking for.

The weird thing is that when I give the UIScrollView a vivid background color (so I can see its dimensions), it has the correct proportions, but the frame and bounds are “incorrect”.

  • 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-17T23:10:44+00:00Added an answer on May 17, 2026 at 11:10 pm

    I got it figured out and it surprised me a bit. First, I noticed that the size of the scroll view was correct (that is, matching the orientation of the device) and that is the reason I based the content size of my scroll view on the bounds of the scroll view (because it turned out that it was an incorrect content size that caused all the trouble).

    This all works fine, but the caveat is that the size of the scroll view (and any other view for that matter) is adjusted to the orientation of the device NOT in the viewDidLoad method, but in the viewWillAppear method. (Just to be clear, with the prior I don’t mean that this actually happens IN the viewDidLoad method).

    So, I wrongly set the content size of the scroll view in the viewDidLoad method, but at that moment the size of the scroll view was “not correct” yet (with “not correct” I simply mean that depending on the orientation of the device, it was not adjusted to the orientation of the device). What I did to solve the issue was moving my method that set the content size of my scroll view to the viewWillAppear method.

    It sounds easy (and it is), but it took me some time to figure this out. I hope this helps anyone with a similar issue in the future.

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

Sidebar

Related Questions

Suppose I have created a UIView , MyView , in Interface Builder, and I
I have an NSWindow that I defined in interface builder. I want to make
I made a UIView using Interface Builder with a top bar that has Cancel
In interface builder i've created a UITextfield within a subclass of a UITableViewCell. The
I wanted to generate one fix view using interface builder, but the size of
When creating a UIView with a navigation bar in interface builder, the top bar
I have two NIB's ParentViewController.xib ChildViewController.xib ParentViewController.xib contains a UIView and a UIViewController. ChildViewController.xib
I am new to iphone development.I have created a UIview controller class and added
What is the best way to create a custom UIView that I can consume
Interface Builder can be used for basic dependency injection in a Cocoa app, but

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.