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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:36:19+00:00 2026-06-12T20:36:19+00:00

I am updating an app to run on the iPhone 5 screen (while maintaining

  • 0

I am updating an app to run on the iPhone 5 screen (while maintaining the old screen size layout as well).

I have a xib file that contains a view controller’s main view, with a horizontal scroll view in it as a subview. This scroll view’s height gets stretched vertically on the iPhone 5 screen.

I also have three views in the xib (used as pages in the scroll view) that get added to the scroll view. I have set all the struts and springs for the top most views to on. I have set all the struts and springs for the subviews inside these views to off.

My problem is that the subviews do not get positioned correctly on the iPhone 5 screen. Specifically I have an image view that should be positioned near the top of the view that is getting moved to the bottom (underneath the other subviews, when they should not be overlapping at all). Setting the top strut to on on the image view causes it to stay at the top of the view, but I want it moved down proportionally to the change in view height.

In my view controller’s viewDidLoad I add the pages to the scroll view like this:

_pageOne.frame = CGRectMake(0, 0, _scrollView.bounds.size.width, _scrollView.bounds.size.height);
[_scrollView addSubview:_pageOne];

_pageTwo.frame = CGRectMake(320, 0, _scrollView.bounds.size.width, _scrollView.bounds.size.height);
[_scrollView addSubview:_pageTwo];

_pageThree.frame = CGRectMake(640, 0, _scrollView.bounds.size.width, _scrollView.bounds.size.height);
[_scrollView addSubview:_pageThree];

The views are set up in the xib for the old screen height. I have checked in the debugger that the scroll view has already been stretched in the viewDidLoad.

How can I get my subviews to reposition correctly?


(Moved response to comment to an answer)

  • 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-12T20:36:20+00:00Added an answer on June 12, 2026 at 8:36 pm

    I actually solved my issue by setting the top and bottom strut on my image view, turning on the vertical spring, and setting the image view’s contentMode to UIViewContentModeCenter.

    But here is how I had my view set up:

    enter image description here

    And here is the result on the iPhone 5.

    enter image description here

    I hadn’t realized that my image view was right at the top of my view. I tried moving the image view down a little, and turning off all of the struts and springs, and everything started behaving as expected:

    enter image description here
    enter image description here

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

Sidebar

Related Questions

While updating a big json list, I'm getting the following error : 2012-04-01T09:34:00+00:00 app[run.1]:
I have a script for building my app that is broken since updating to
I have an app that runs 2 threads in loops. 1st one is updating
I have file test.pdf in my Application Bundle. I run test in iPhone Simulator
I have been updating an app that uses location services. Once of the changes
I have a Sinatra app that I run as a daemon, using Apache port-forwarding
i have a problem with updating my textview. i am making a c2dm app.
I have created one testing app for running deep counter loop. I run the
I have a web app that sends customized emails to my users throughout the
Just came across a problem while updating an existing app to iOS 6. in

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.