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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:14:49+00:00 2026-05-28T05:14:49+00:00

I have a scrollview that always shows three items. I need the middle item

  • 0

I have a scrollview that always shows three items. I need the middle item to be big, and the items on the left and the right to be small.

My question is, how can I detect a paging swipe? What I was planning on doing is everytime the scrollview has been “paged”, we detect it then check all the items in the scrollview – if the item is in the middle “frame” we make it bigger, otherwise it is smaller.

Am I going about this the best way?

  • 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-28T05:14:50+00:00Added an answer on May 28, 2026 at 5:14 am

    You need to have a delegate on your UITableView that accepts the scrollViewDidScroll: message (or perhaps scrollViewDidEndDecelerating:, depending on your needs). See the UITableViewDelegate documentation.

    I do this kind of check inside scrollViewDidScroll. I check the current content offset, and if the rectangle formed by the current offset and the size of the scroll view frame are suitably intersecting with one of my scroll view pages, then I have that page update. Here, you might want to scale each item proportionally to how close it is to the center of the current content offset (which would create a nice dock style magnification effect for your scroller).

    Edit: So, hypothetical untested pseudocode for an array of “items” in a scroller that pages horizontally.

    - (void)scrollViewDidScroll:(UIScrollView *)scrollView
    {
      CGPoint *currentOffset = scrollView.contentOffset;
    
      for (UIView *item in itemsToDisplay)
      {
        // The location in the entire scroll view canvas at which
        // we consider this item to "live"
        CGPoint *naturalCentre = item.naturalCentre;
    
        // How far from our desired point are we?
        CGFloat scale = 100 - fabs(naturalCentre.x - contentOffset.x);
        // Clamp this to positive values only, and normalize from 0.5 to 1
        scale = 0.5 + (scale < 0 : 0 ? (scale / 200));
    
        // Scale this view accordingly
        item.layer.contentsScale = scale;
      }
    }
    

    That’s written off the cuff, and will need rather a lot of debugging.

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

Sidebar

Related Questions

I have an app that shows a series of UIImageView s on a ScrollView
I have a scrollview control that has a StackPanel (Orientation=Vertical) UI Element inside of
I have a TabControl with two tabs containing lists that should always be scrolled
I have an app that has a scrollview with a bunch of different textviews
I need a PickerView, that behaves like a normal UIPickerView, but only shows one
I have a scrollView that I'd like to programmatically move based on the delta
I have a UIViewController, which uses a UIScrollView and within that Scrollview it has
I have an Activity that consists of a large scrollview (that contains EditText fields)
I have a ViewController with a view that contains a ScrollView and a PageControl
I have a application that need event handling on a unusual way. For my

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.