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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:25:49+00:00 2026-06-07T14:25:49+00:00

So I have a UIScrollview that scrolls horizontally with paging through a bunch of

  • 0

So I have a UIScrollview that scrolls horizontally with paging through a bunch of different UIImageViews containing user avatars. But, I want to only load the avatars from their URL IFF they are actually showing on the screen (4 are showing at a time, but I can scroll through like 30 or more or less). Is there a way of detecting which UIImageView/ which page it is on? Or does anyone have any general recommendations or ideas for how I should go about this problem? Thank you in advance.

  • 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-07T14:25:51+00:00Added an answer on June 7, 2026 at 2:25 pm

    -(void)scrollViewDidScroll:(UIScrollView *)scrollView{

    -(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
            CPoint offset = scrollView.contentOffset;
            int index = offset.x / pageWidth;
            switch (index) {
                case 0:
                    //first ImageView
                    break;
                case 1:
                    //second ImageView
                    break;
                default:
                    break;
            }
        }
    

    Or If you tag your imageViews (starting at 1) you can retrieve them via:

    -(void)scrollViewDidScroll:(UIScrollView *)scrollView{

    -(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
        CPoint offset = scrollView.contentOffset;
        int index = offset.x / pageWidth;
        UIImageView *visibileImageView = (id)[scrollView viewWithTag:index+1];
    }
    

    You can use scrollViewDidScroll to detect the position at any point if you use the modulus:

    int index = (offset.x - offset.x % pageWidth)/pageWidth;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have a UIScrollView that scrolls less then the full screen so
I have a custom-drawn view that I include in a UIScrollView that scrolls horizontally.
I have a paging UIScrollView that pages through multiple full screen images. I am
I have a UIScrollView that houses a gallery of images the user can scroll
I have a UIScrollView that contains multiple UITableViews horizontally - all of which are
I have UIScrollView which i populate with UIImageViews programmatically. After that I change contentSize
I need to create a view on the iPhone that scrolls horizontally through a
I have a horizontally scrolling UIScrollView and I want to display potentially thousands of
I have a horizontal UIScrollview set up (meaning its not one that scrolls up
I have a UIScrollView with nested UIImageViews. Each imageview can zoom, but when I

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.