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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:12:57+00:00 2026-06-12T11:12:57+00:00

When I make and setup a scrollView in Xcode, It never works. It simply

  • 0

When I make and setup a scrollView in Xcode, It never works. It simply wont scroll and show my content! I have coded the backend of it but no go! I have been using this tutorial since iOS 4: Devx Scrollview Tutorial

Now, I think it is broken in iOS 6 due to the new screen size on the new iPhone. Here is the backend code I have been using:

    scrollView.frame = CGRectMake(0, 0, 320, 520);

//---set the content size of the scroll view---
[scrollView setContentSize:CGSizeMake(320, 520)];
// Do any additional setup after loading the view.

The scrollview sizes in Xcode are Width: 320, Height: 520.

What am I doing wrong? It is probably something stupid.

Update:

 - (void)viewDidLoad
{
    [super viewDidLoad];
      [self.overlay removeFromSuperview];
    NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];

    [nc addObserver:self selector:@selector(keyboardWillShow:) name:
     UIKeyboardWillShowNotification object:nil];

    [nc addObserver:self selector:@selector(keyboardWillHide:) name:
     UIKeyboardWillHideNotification object:nil];

    tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
                                                            action:@selector(didTapAnywhere:)];
    [self customizeAppearance];
     self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"stone.png"]];

    [scrollView setScrollEnabled:YES];
    scrollView.frame = ([UIScreen mainScreen].bounds);

    //---set the content size of the scroll view---
    [scrollView setContentSize:CGSizeMake(320, 800)];


    // Do any additional setup after loading the view.
}
  • 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-12T11:12:58+00:00Added an answer on June 12, 2026 at 11:12 am

    You set the frame size and content size to be the same. Where do you expect the scroll view to scroll to? You should set the UIScrollView‘s frame to be where you want the viewport to be on the screen (probably [UIScreen mainScreen].bounds), and the contentSize to be the total area you want the scroll to reach, it sounds like you want this to be 320×520.

    I’ve written a simple example program. I created a new “single view” project and just put this in the viewDidLoad method of the main VC:

    UIScrollView *sv = [[UIScrollView alloc] initWithFrame:CGRectMake(20, 20, 280, 424)];
    UILabel *top = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 280, 50)];
    top.text = @"TOP";
    top.textColor = [UIColor greenColor];
    top.backgroundColor = [UIColor blackColor];
    top.textAlignment = UITextAlignmentCenter;
    [sv addSubview:top];
    
    UILabel *bottom = [[UILabel alloc] initWithFrame:CGRectMake(0, 500, 280, 50)];
    bottom.text = @"BOTTOM";
    bottom.textColor = [UIColor greenColor];
    bottom.textAlignment = UITextAlignmentCenter;
    bottom.backgroundColor = [UIColor blackColor];
    [sv addSubview:bottom];
    
    sv.backgroundColor = [UIColor orangeColor];
    sv.contentSize = CGSizeMake(280, 550);
    
    [super.view addSubview:sv];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am trying to make a setup of windows service.but when i was building
I´m using NSIS editor to make a setup for my application, but I don´t
Our setup runs vcredist_x86.exe with Parameter /qb to make it silent . This works
I have an application that uses SQL Server Express. How to make setup that
I have written c# application that uses mdf file for database.when i make setup
I have developed a small application and want to make its setup. Is it
My current setup.py script works okay, but it installs tvnamer.py (the tool) as tvnamer.py
how can I make setup.py file for my own script? I have to make
So I have the following little script to make a file setup for organizing
How can I make sure setup.py compiles projects PO files and include them whenever

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.