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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:39:09+00:00 2026-05-30T20:39:09+00:00

I have an infinite scrollview in which I add images as the user scrolls.

  • 0

I have an infinite scrollview in which I add images as the user scrolls. Those images have varying heights and I’ve been trying to come up with the best way of finding a clear space inside the current bounds of the view that would allow me to add the image view.

Is there anything built-in that would make my search more efficient?

The problem is I want the images to be sort of glued to one another with no blank space between them. Making the search through 320×480 pixels tends to be quite a CPU hog. Does anyone know an efficient method to do it?

Thanks!

  • 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-30T20:39:11+00:00Added an answer on May 30, 2026 at 8:39 pm

    It seems that you’re scrolling this thing vertically (you mentioned varying image heights).

    There’s nothing built in to UIScrollView that will do this for you. You’ll have to track your UIImageView subviews manually. You could simply maintain the max y coordinate occupied by you images as you add them.

    You might consider using UITableView instead, and implementing a very customized tableView:heightForRowAtIndexPath: in your delegate. You would probably need to do something special with the actual cells as well, but it would seem to make your job a little easier.

    Also, for what it’s worth, you might find a way to avoid making your solution infinite. Be careful about your memory footprint! iOS will shut your app off if things get out of hand.

    UPDATE

    Ok, now I understand what you’re going for. I had imagined that you were presenting photographs or something rectangular like that. If I were trying to cover a scroll view with UILeafs (wah wah) I would take a statistical approach. I would ‘paint’ leaves randomly along horizontal/vertical strips as the user scrolls. Perhaps that’s what you’re doing already? Whatever you’re doing I think it looks good.

    Now I guess that the reason you’re asking is to prevent the little random white spots that show through – is that right? If I may suggest a different solution: try to color the background of your scroll view to something earthy that looks good if it shows through here and there.

    Also, it occurred to me that you could use a larger template image — something that already has a nice distribution of leaves — with transparency all along the outside outline of the leaves but nowhere else. Then you could tile these, but with overlap, so that the alpha just shows through to the leaves below. You could have a number of these images so that it doesn’t look obvious. This would take away all of the uncertainty and make your retiling very efficient.

    Also, consider learning about CoreAnimation (CALayer in particular) and CoreGraphics/Quartz 2D ). Proper use of these libraries will probably yield great improvements in rendering speed.

    UPDATE 2:

    If your images are all 150px wide, then split your scrollview into columns and add/remove based on those (as discussed in chat).

    Good luck!

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

Sidebar

Related Questions

I have a form which contains infinite number of options which user and add.
This program will have an infinite canvas (ie as long as the user scrolls,
I'm trying to optimize an (infinite) computation algorithm. I have an infinte Sum to
I have a infinite scroll script which works for my tumblr . It's loading
I have infinite number of divs of a 100px width, which can fit into
I have 5 pictures inside an infinite scrollView. So in order to make that
I need to do some calculations with fractions which result have infinite decimals. For
I have an infinite Carousel function applied to a series of images here: http://nokkam.com/showcase.html
I have a PHP script with infinite loop. I need this script running forever.
Suppose we have an iterator (an infinite one) that returns lists (or finite iterators),

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.