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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:47:38+00:00 2026-06-12T09:47:38+00:00

What I want is a UIScrollView that has a repeating tiled image as a

  • 0

What I want is a UIScrollView that has a repeating tiled image as a background.

The obvious answer to this question is as follows:

myScrollView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"myRepeatingImage.png"]];

However, this solution has multiple problems…

  1. Performance is terrible.
  2. It does not “work” with zooming correctly.

My next thought is to add a UIView (we’ll call it backgroundView) to myScrollView with a repeating image as a background color, and add all subviews to the backgroundView. However, this could get really messy with constantly resizing the backgroundView so that when a user zooms out (even temporarily beyond the minimum zoom level), you cannot see “around” the backgroundView.

Any suggestions?

Similar to this question, but the question was unanswered
UIScrollView with pattern image as background

  • 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-12T09:47:39+00:00Added an answer on June 12, 2026 at 9:47 am

    I think this is what you’ll want to do.

    Put some number (z) of UIImageView’s as the background. Extract these into a separate control so you only have to add one “background view”. Say you want to scroll up, down, left, and right. You also want to zoom out beyond the content size. So, you need x amount of images to cover your scroll views width, and s images to buffer the width on a zoom. (y to cover height and t to buffer height, so z = x + r + y + t)

    Side note: When I say buffer the width, I mean put the images at an origin that lies outside the bounds of the content size. That way when zooming out past the content bounds, you will see these images, and not “around” the background.

    When you scroll to the right a sufficient distance (based on your image size related to the scroll view bounds, or what is the visible frame), then move the now none visible image view to the right side of the right-most image view. Do the analogous thing for scrolling left, up, and down. You might need to add/remove image views when zooming occurs… or just use the maximum number of image views needed at all times.

    The point is to increase performance, so ideally the number of image views your working with is small. The number increases proportionally to sizeof(scrollview.bounds)/sizeof(image). sizeof meaning frame size, not bytes, naturally.

    EDIT:
    To help illustrate this concept, we might make the following analogy. The scrollview is a lens looking in at part of a tiled floor, the content background of the scrollview is the tiled floor. However, we are only using a sufficient amount of tiles based on the lens. As the lens moves, we move non-visible tiles into areas where the lens will move to. As the lens zooms out, we add tiles (if removing them as we zoom in). I hope that helps clear things up instead of make it more confusing.

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

Sidebar

Related Questions

I want to implement a UIScrollView that has a circular shape in iPhone, kindly
I have a UIView that contains a UIScrollView and I want to be able
I have a UIView inside of a UIScrollView that I want to resize. I
HI, I have a view that has three UIScrollViews on the screen. I want
I have rows of subviews within a UIScrollView that I want to rearrange after
Basically, I want to have an app with only one view that has an
So I have a UIViewController subclass called MyTabBarViewController that has a UIScrollView. Inside of
I have a UIScrollView that has a single child view within it. If I
I'm working on a app that has a paging UIScrollView that contains three scrollViews
I have a UIView that has a UIScrollView as a subview, which in turn

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.