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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:01:14+00:00 2026-05-25T18:01:14+00:00

I have a UIScrollView which is resized when the keyboard is presented (to stay

  • 0

I have a UIScrollView which is resized when the keyboard is presented (to stay above the keyboard as it slides in from the bottom.) To make the animation work right I have to specify UIAnimationOptionBeginFromCurrentState. If I don’t specify this I get weird effects during the animation and I can see the view behind the UIScrollView peek through. Here’s the animation routine:

- (void) onKeyboardWillShow: (NSNotification*) n
{
    // get the keyboard rect
    CGRect rKeyboard; NSValue* v;
    v = [n.userInfo objectForKey: UIKeyboardFrameEndUserInfoKey];
    [v getValue: &rKeyboard];
    rKeyboard = [self.view convertRect: rKeyboard fromView: nil];   

    // get the keyboard animation duration, animation curve
    v = [n.userInfo objectForKey: UIKeyboardAnimationDurationUserInfoKey];
    double keyboardAnimationDuration;
    [v getValue: &keyboardAnimationDuration];

    v = [n.userInfo objectForKey: UIKeyboardAnimationCurveUserInfoKey];
    UIViewAnimationCurve keyboardAnimationCurve;
    [v getValue: &keyboardAnimationCurve];

    // animate
    [UIView animateWithDuration: keyboardAnimationDuration 
                          delay: 0 
                        options: UIViewAnimationOptionBeginFromCurrentState | keyboardAnimationCurve 
                     animations: ^{

                         CGRect f = _clientAreaView.frame;
                         f.size.height = rKeyboard.origin.y - f.origin.y;
                         _clientAreaView.frame = f;
                     }
                     completion: ^(BOOL finished) {
                     }];
}

The problem is the UIScrollView backgroundColor, which is set to scrollViewTexturedBackgroundColor. After the animation the textured background is compressed (with minor artifacts showing). If I animate it all back to the original size it returns to normal.

How to make it so the background either doesn’t resize with the animation, or at least have the background ‘pop’ back to an uncompressed look post animation? I tried setting the bg color in the completion routine (to white, then back to scrollViewTexturedBackgroundColor, but this didn’t work, and I dont really understand why.)

  • 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-25T18:01:15+00:00Added an answer on May 25, 2026 at 6:01 pm

    I think your problem might be related to setting the value of UIKeyboardAnimationCurveUserInfoKey (which is a UIViewAnimationCurve and not a UIViewAnimationOption) along with UIViewAnimationOptionBeginFromCurrentState (which is supposed to capture the current state and modify it).

    Animating the frame of UIScrollView (and UITableView) is buggy on iOS, therefore you should animate the contentInset and scrollIndicatorInsets properties as well as the contentOffsetif you need to reposition your views (e.g. moving a text field up).
    Just add the height of the keyboard to the bottom part of the insets and calculate if you need to scroll up or down.

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

Sidebar

Related Questions

I have a UIWebView which is embedded in a UIScrollView. The webView is resized
Right now, I have a UIScrollView which scales its UIView contents on zoom events.
I have a UIScrollView which I create and size dynamically using... scrollView.contentSize = CGSizeMake(scrollView.frame.size.width
I have a UIScrollView which has an UIImageView in it. I need to be
I have an Image inside UIScrollView which i can zoom in and out. I
I have subclassed UIView object inside a uiscrollview which displays a pdf page. I
I have a UIScrollView that contains multiple UITableViews horizontally - all of which are
I have a UIScrollView which contains a sub-UIView, insetView which is used to display
I have a UIScrollView which contains many UIImageView s, UILabels, etc... the labels are
I have a UIScrollView which I am applying a black background, which blends in

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.