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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:47:15+00:00 2026-05-25T14:47:15+00:00

How do I set the starting point of a UIScrollView? I would like to

  • 0

How do I set the starting point of a UIScrollView? I would like to add a UIImageView left of the UIScrollView but changing the contentSize only adds scrolling room to the right of the scrollview. How do I add an ImageView left of the scrollView’s (0,0) point and make it part of the scrollview’s content size?

  • 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-25T14:47:16+00:00Added an answer on May 25, 2026 at 2:47 pm

    Hopefully I’ve got what you’re trying to do here. I think this just takes a few turns with the contentOffset to get right.

    Starting off;

    • Add the scrollView at frame (0,0,320,480) – its a full screen scroller
    • set contentSize to (320*3, 480) – it now has a content with the width of 3 ‘pages’
    • Add your imageView as a subview to the scrollView at frame (320,0,320,480)
    • set contentOffset of the scrollView to (320, 0) – this will move the content of the scrollView left, in the negative x direction by 320
    • Now your imageView will be on screen, but it will have a 320px width both on the left and right on the scroller content.

    (Note that in the code below, i’ve simply added a UIView and not an imageView)

    UIScrollView *scroller = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
    scroller.delegate = self;
    scroller.pagingEnabled = YES;
    scroller.backgroundColor = [UIColor blueColor];
    scroller.contentSize = CGSizeMake(960, 480);
    
    UIView *imgView = [[UIView alloc] initWithFrame:CGRectMake(320, 0, 320, 480)];
    [imgView setBackgroundColor:[UIColor redColor]];
    [scroller addSubview:imgView];
    
    [scroller setContentOffset:CGPointMake(320, 0)];
    [self.view addSubview:scroller];
    

    Does that help?

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

Sidebar

Related Questions

How do I set a starting offset for each loop in ruby? I want
Starting with the error: Error 81 The OutputPath property is not set for this
Just starting out with subversion, have set up repos for 3 current projects and
Starting from Visual Studio 2010, iterating over a set seems to return an iterator
Set rs = conn.Execute(Statement) //rs has 6 fields I want to add the current
I have an Excel workbook that is used as a starting point to generate
I am interested in starting Mobile application Development.There are many suggestions on internet but,I
I developed a simple Ruby Hello World application. Now i would like to consume
My starting point is basically Ryan Bate's RailsCast . I have modified his code
I was reading this: http://www.gameprogrammer.com/fractal.html#diamond And it says: This is the starting-point for the

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.