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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:59:23+00:00 2026-05-13T08:59:23+00:00

I am working on a side-scrolling iPhone app, and I have every resource, except

  • 0

I am working on a side-scrolling iPhone app, and I have every resource, except the actual side scrolling part! How do I make an app so that it side-scrolls? To be more specific, I want the view of the app to scroll when a UIImageview(player) hits the right/left border of the screen.

<:EDIT:>
I am extremely sorry for all of this confusion! All I am making is a SAMPLE iPhone app only to be used in the simulator. In the app, I have a UIImaageview that moves when you touch arrow UIImageviews. PLEASE NOTE THAT ALL INFORMATION SAID BEFORE THIS SENTENCE WORKS PERFECTLY! Now, my problem is that I want the UIView to scroll only ONE picture(this means it doesn’t go forever ;)). I have tried using a UIScrollView, but that didn’t work. Finally, I am not planning to use Cocos2D or any other game engine besides a basic UIview. This is only a test app, not a coding extravaganza…

  • 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-13T08:59:24+00:00Added an answer on May 13, 2026 at 8:59 am

    Start with a view-based application template so you can get the gist of how this works. Later you can integrate with your existing code.

    Create a seamless background image 320 x 960 pixels, named “seamless.png”

    Add this ivar to your view controller .h file

    UIImageView *bg;
    
    @property (nonatomic, retain) UIImageView *bg;
    

    In your .m file add these #defines before the @implementation line, the @synthesize after.

    #define kUpdateRate (1.0 / 60.0)
    #define kMoveY (3.0)
    #define kTopY (0.0)
    #define kBottomY (480.0)
    @synthesize bg;
    

    Add this method.

    -(void)scrollView; {
     float oldY = self.bg.center.y + kMoveY;
     float newY = oldY;
    
     if (oldY > kBottomY) {
      newY = kTopY;
      }
    
     self.bg.center = CGPointMake(self.bg.center.x, newY);
    }
    

    Add this to your viewDidLoad method.

     self.bg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"endless.png"]];
     [self.view addSubview:self.bg];
     self.bg.center = CGPointMake(self.bg.center.x, kTopY);
    
     [NSTimer scheduledTimerWithTimeInterval:kUpdateRate target:self selector:@selector(scrollView) userInfo:nil repeats:YES];
    

    When you run the app, you should have a nice scrolling background.

    To sum up what happens: A timer is set up to repeatedly call scrollView:

    There, the image is moved downwards until it reaches a predefined point (kBottomY), at which time its position is jumped back up to the top (kTopY) and it starts over again.

    You can customize it to only scroll when you want it to or scroll the other way on your own, right?

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

Sidebar

Related Questions

I am working with ASP.NET doing some client side javascript. I have the following
I'm working on a web app which is heavy on the client side, which
On the web side we are working on getting source control. Now, I want
Working with a SqlCommand in C# I've created a query that contains a IN
Working on a project at the moment and we have to implement soft deletion
Working on a project that parses a log of events, and then updates a
Working in Eclipse on a Dynamic Web Project (using Tomcat (v5.5) as the app
I have a script that appends some rows to a table. One of the
Working with dates in ruby and rails on windows, I'm having problems with pre-epoch
Working on a somewhat complex page for configuring customers at work. The setup is

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.