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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:09:11+00:00 2026-06-05T05:09:11+00:00

So i got an imageView inside a ScrollView that should resize, which works the

  • 0

So i got an imageView inside a ScrollView that should resize, which works the way i want (see a small video here: https://dl.dropbox.com/u/80699/scroll.m4v)

what i did is setting up a UIScrollViewDelegate and using the scrollViewDidScroll method to resize my image based on the scrolling offset

- (void)scrollViewDidScroll:(UIScrollView *)aScrollView
{
    CGFloat scrollViewOffset = aScrollView.contentOffset.y;

    if(scrollViewOffset < 0.0f) {
        // postition top
        CGRect imageViewRect = self.imageView.frame;
        imageViewRect.origin.y = scrollViewOffset;

        if(scrollViewOffset < 0.0f && scrollViewOffset >= -50.0f) {
            CGFloat newBackdropHeight = kImageHeight - scrollViewOffset;
            imageViewRect.size.height = newBackdropHeight;
        }

        self.imageView.frame = imageViewRect;
    }
}

whats basically happening here is, that if the user is scrolling upwards when he is on the top (bounces enabled) the imageView expands with the scroll until a certain amount of offset(here 60px).

the problem with this is, that if i scroll very fast, the image stops resizing, but the rest of the scrollview scrolls fast down like it would normally do. then, when the scrollview snaps back, the image expands immediately and then scales down like it should (see video here: https://dl.dropbox.com/u/80699/scroll2.m4v).

with this behavior, the user-expierience is not very nice and the user sees a jumping image.

does anybody know how i could fix this?

here is a small sample project if you want to see the behavior yourself: https://dl.dropbox.com/u/80699/scroll.zip

thanks for your help!
if anything is unclear, PLEASE leave a comment

  • 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-05T05:09:14+00:00Added an answer on June 5, 2026 at 5:09 am

    I had a quick look at your test project, and I believe the issue is that when you scroll quickly, by the time the callback is called the Y offset is greater than -50, so the image view is not resized.

    I solved this by removing the inner if condition and giving the backdrop a maximum height:

    if(scrollViewOffset < 0.0f) {
        // postition top
        CGRect imageViewRect = self.imageView.frame;
        imageViewRect.origin.y = scrollViewOffset;
    
        CGFloat newBackdropHeight = kImageHeight - MAX(scrollViewOffset,-50.0);
        imageViewRect.size.height = newBackdropHeight;
    
        self.imageView.frame = imageViewRect;
    }
    

    Hope that helps

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

Sidebar

Related Questions

I've got a small ImageView inside of a fullscreen FrameLayout, and I'd like to
Here you can see I've got the LL_BtnR layout inside the longer linearLayout3. LL_BtnR's
i've got a problem with iPhone SDK. I want create an imageView that user
I've got an ImageView which I'm setting to setImageResource(R.drawable.someStateListDrawable) . Everything works fine, when
I've got a ListView that works just great, except for this minor annoyance. I
I got a 9 patch image which is the background of some imageview on
I've got the following code which should put an image in the top section/cell
I've got a horizontal LinearLayout (inside of another LinearLayout ) containing a few ImageView
I've got an ImageView that I've wrapped in a LinearLayout. The LinearLayout has a
i ve got an imageview ..below the imageview is a table view..which loads the

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.