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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:39:26+00:00 2026-05-18T04:39:26+00:00

i just noticed, having a backgroudn image inside of a UIScrollView along with some

  • 0

i just noticed, having a backgroudn image inside of a UIScrollView along with some other UI-Elements, that they scroll with different speed.

i created a UIScrollView child in my main view, added this testing code:

-(void)viewDidLoad {
[super viewDidLoad];

oRulerYear.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed:@"bg.png"]];
//bigsize!
[oRulerYear setContentSize:CGSizeMake(2400,100)]; 

CGFloat x = 0;
CGFloat y = 0;

CGRect rect = CGRectMake(x , y, 120.0f, 45.0f);

//label 1
UILabel *label = [[[UILabel alloc] initWithFrame:rect] autorelease];
[label setText:@"Foo"];
[oRulerYear addSubview:label];


//label 2
x = 2000;
y = 10;
rect = CGRectMake(x , y, 120.0f, 45.0f);
UILabel *label2 = [[[UILabel alloc] initWithFrame:rect] autorelease];
[label2 setText:@"Bar"];
[oRulerYear addSubview:label2];

}

Scrolling DOES work, but i see a differen speed of scrolling on both label tags.
so its quite like an 1980 pc game, or reverted parallax-scrolling or however its called. background seem to scroll faster than foreground.

Any ideas how to prevent that behaviour?

  • 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-18T04:39:27+00:00Added an answer on May 18, 2026 at 4:39 am

    You need to set the background pattern on a child view of the paging UIScrollView, not on the paging UISCrollView itself.

    #define OUTERPADDING 160
    CGRect backgroundFrame = CGRectMake(-OUTERPADDING, 0,
         pagingScrollView.contentSize.width + 2*OUTERPADDING,
         pagingScrollView.contentSize.height);
    UIView * backgroundView = [[UIView alloc] initWithFrame:backgroundFrame];
    backgroundView.backgroundColor = [UIColor colorWithPatternImage:
            [UIImage imageNamed:@"walnut"]];
    [pagingScrollView addSubview:backgroundView];
    

    This view has to be as big as the content size and even more for a clean result. OUTERPADDING is used to ensure that the pattern is applied on half the screen before the first and after the last pages

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

Sidebar

Related Questions

Having just started with MVC 2 I notice that in their starter template they
Having just updated Mono to 2.6.3 (on OS X), I noticed in the installer
I just noticed that moving the mouse cursor across a tooltip does not seem
I just noticed that java.beans.Introspector getBeanInfo does not pickup any superinterface's properties. Example: public
I just noticed that say http://s7.addthis.com/js/250/addthis_widget.js#pub=PUBID does the equivalent of http://s7.addthis.com/js/250/addthis_widget.js?pub=fct-250 but is much
I just noticed that for vector push_back it is push back a reference to
I just noticed that live() is already deprecated in jQuery. I have quick question
I've just noticed that, while most of getters from a Bundle have the possibiliy
I just noticed that you can do this in C#: Unit myUnit = 5;
I just noticed that MediaScanner marks 3gp file with video/mp4. I've searched about it

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.