Skip to content

Not animating UIImageView with autolayout #160

Closed

Description

@cytryn

Hi, I am making my login screen and when I hit a textfield it seems like its seting the uiimageview frame instead of rolling the animation with autolayout.

Is there anything I can do to fix this?

UIImageView set with autolayout:
http://cl.ly/image/1M0v3M391f0F

Video showing the behavior:
http://cl.ly/0815060A2o0U

Activity

  1. hackiftekhar commented on Feb 7, 2015

    @hackiftekhar
    Owner

    Looks like you've top pinned your UIImageView with TopLayoutGuide.
    TopPinning to superView will solve the issue. For detail explanation please
    refer issue #124.

    On Saturday, February 7, 2015, Andre notifications@github.com wrote:

    Hi, I am making my login screen and when I hit a textfield it seems like
    its seting the uiimageview frame instead of rolling the animation with
    autolayout.

    Is there anything I can do to fix this?

    UIImageView set with autolayout:
    http://cl.ly/image/1M0v3M391f0F

    Video showing the behavior:
    http://cl.ly/0815060A2o0U

    —
    Reply to this email directly or view it on GitHub
    #160.

    Sent from My iPhone

  2. cytryn commented on Feb 8, 2015

    @cytryn
    Author

    Thats not quite the result I wanted...

    I would like to keep the logo at the screen, so the autolayout is fine for that to work.

    The problem is that the frame is being reset instead of being animated. I dont know exactly whats responsible for this but the result I would like to see is my logo shrinking animated instead of poping smaller/bigger.

  3. hackiftekhar commented on Feb 8, 2015

    @hackiftekhar
    Owner

    Under the hood, I'm finding topViewControlller in UIWindow hierarchy and moving it's view frame up-down, but due to top pining from top layout guide, your image is not moving with view, image is keeping distance from top layout guide. Could you please elaborate what behaviour you want to achieve?

  4. cytryn commented on Feb 9, 2015

    @cytryn
    Author

    How is it working now: as I hit the textField, they key board goes up as does the view, both animated (rolling up/down swiftly).
    My image (orange in demo video) does not animate. It has only 2 states: before the animation begins and after the animation ends.

    How I wanted it to work: instead of the 2 states, I wanted my image to animate according to the autolayout. In the demo video it should shrink animated as I go to the next responder.

    Dont get me wrong, pinning to the view works just fine but the logo gets hidden as the view scrolls. I want to keep all the logo on the screen resizing it with animation, thats why I pinned to the top layout guide.
    If my desired behavior is not possible, no problem. I will keep with the view pin solution.

    Thanks for you time so far.

  5. hackiftekhar commented on Feb 10, 2015

    @hackiftekhar
    Owner

    Ok, I'll check it and let you know my feedback. Thanks

  6. hackiftekhar commented on Feb 11, 2015

    @hackiftekhar
    Owner

    I checked the demo video and now understand what animation behaviour you wanted. I'm changing the self.view frame not UIImageView frame. UIImageView frame is resetting by the Auto-layout Engine. Changing self.view frame is doing in '-(void)setRootViewFrame:(CGRect)frame' method. You can play a hit & try with setNeedsLayout and layoutIfNeeded in animation block where library update rootViewController.view's frame.

    Please let me know the status of bug after trying above approach. Waiting for your reply.

    Thanks
    Iftekhar

  7. cytryn commented on Feb 13, 2015

    @cytryn
    Author

    If I understand correctly, I was supposed to try this at your IQKeyboardManager.m

    None of the tries worked =/

  8. hackiftekhar commented on Feb 13, 2015

    @hackiftekhar
    Owner

    The library is updating frame of self.view in an animation block internally and nothing more. Don't know why your image is not animating like you want.

  9. added 2 commits that reference this issue on Jun 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions