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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:50:05+00:00 2026-06-16T20:50:05+00:00

I have been working on a project in XCode 4.5.2 and have various uiviews

  • 0

I have been working on a project in XCode 4.5.2 and have various uiviews set up and looking the way I want them and all working.

On one view, I am needing to now add a uiscrollview, as the content is going to be larger than the page, and will need to scroll vertically.

I have added a uiscrollview, and set the content size, etc, in viewdidload

[scrollView setScrollEnabled:(YES)];
[scrollView setContentSize:CGSizeMake(320,650)];

When I run this and try to scroll vertically, I can see the scroll bar appearing, so the uiscrollview is working and scrolling, but all the content I already added to my uiview stays still and doesnt move.

I have tried adding a small quick test image programmatically to the scrollview

CGRect imageViewFrame = CGRectMake(10,10,10,10);
UIImageView *imageView = [[UIImageView alloc] initWithFrame:imageViewFrame];
imageView.image = [UIImage imageNamed:@"1001_a.jpg"];
[scrollView addSubview:imageView];

And this small image works and scrolls as it should with the scrollview, but all the other previously added content, labels, images, etc, all still stay where they were and dont move at all.

I am assuming this is something to do with subviews, and all my previous existing content is not a subview of the scrollview – but how do I correct this?

I already have my page and uiview laid out in interface builder, and dont really want to delete everything and add all the content programatically as I did with the small test image.

Is there something I need to do in the viewdidload to set the existing content as a subview to the uiscrollview?

[scrollView addSubview:???];

Many thanks for any tips or advice in advance – this is driving me crazy!!

If you need any screenshots or further code, happy to attach.

  • 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-16T20:50:06+00:00Added an answer on June 16, 2026 at 8:50 pm

    The problem is that all your stuff is added to the UIView, not the scrollview. Scrolling the scrollview only scrolls it’s children, that’s why your test image DOES scroll. If you’re building this in a nib, you just need to drag all the stuff that needs to scroll INSIDE the scrollview and it will work. You could also change the controller UIView to be a UIScrollView itself. That’s on the 3rd tab in the right bar of utilities, where it says custom class, change it to UIScrollView. You’ll lose some versatility by doing it this way but it’s the fastest way.

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

Sidebar

Related Questions

I have an XCode 4.2 project that I've been working with all day just
Hey so I have been working on a project that I want to be
I have been working through the tutorial adapting it to a project I want
I have been refraining from upgrading Xcode until one specific project is out of
I have been working on a project which is about data copy from one
I have a small c++ project I've been working on in XCode, that I'd
I'm pretty new to xcode. I've been working on a project, where I have
I have been working some days on this Xcode 4.5 ios project, but suddenly
I have an iPhone (Xcode) Project that was working fine. Something must have been
I have been working on a project in C# (.net4). Project pretty much allows

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.