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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:38:43+00:00 2026-05-12T22:38:43+00:00

I have one UIView, which I’m using as my main view, and I want

  • 0

I have one UIView, which I’m using as my main view, and I want to repeat the subview across the screen. How exactly can I do this?

  • 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-12T22:38:44+00:00Added an answer on May 12, 2026 at 10:38 pm

    You can look at Core Animation. There is a layer called the CAReplicatorLayer that might help you. Alternatively you can use generic CALayers and set their contents all to the same image. You would just need to figure out the width of your parent view and how big you want each tile to be and then just create CALayers for each tile shifting the position of each new layer depending on your grid dimensions. Something like this:

    UIImage *imageToReplicate = [UImage imageNamed:@"tile"];
    for (i = 0; i < 10; ++i)
    {
        for (j=0; j < 10; ++j)
        {
            CGFloat xPos = 0.0; // Calculate your x position
            CGFloat yPos = 0.0; // Calculate your y position
    
            CALayer *layer = [CALayer layer];
            [layer setBounds:CGRectMake(0.0f, 0.0f, TILE_WIDTH, TILE_HEIGHT)];
            [layer setPosition:CGPointMake(xPos, yPos)];
            [layer setContents:(id)[image CGImage]];
            [[[self view] layer] addSublayer:layer];
        }
    }
    

    You’ll have to figure out the calculation for each iteration of your layer positions. Remember that by default the anchor point of the layer is its center. You either calculate it by subtracting half of the layer tile size or you can change the anchor point to be a corner instead. For more information on that, take a look at the layer geometry section of the Core Animation documentation.

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

Sidebar

Related Questions

I have a scroll view which has one UIView inside which contains the content.
I have one single MainViewController which has of course it's one main UIView. I
I have one uiimageview which is added as subview in uiview. frame for uiimageview
I need to have two UITableViews on one UIView. I can make it work
I have 3 UIViews, layered on top of one large uiview. I want to
I have one UITextView which is on the bottom of view. When user tap
I have one view controller in which I have added UIScrollView & UIImageView programatically.
I have a UIView which I create with initWithFrame and it displays fine, exactly
I have one UIView with an UIImageview in which i have an image downloaded
I have a UIView which contains many items like UIScrollView. How can I specify

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.