Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not animating UIImageView with autolayout #160

Closed
cytryn opened this issue Feb 6, 2015 · 8 comments
Closed

Not animating UIImageView with autolayout #160

cytryn opened this issue Feb 6, 2015 · 8 comments
Labels

Comments

@cytryn
Copy link

cytryn commented Feb 6, 2015

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

@hackiftekhar
Copy link
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 [email protected] 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

@cytryn
Copy link
Author

cytryn commented Feb 8, 2015

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.

@hackiftekhar
Copy link
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?

@cytryn
Copy link
Author

cytryn commented Feb 9, 2015

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.

@hackiftekhar
Copy link
Owner

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

@hackiftekhar
Copy link
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

@cytryn
Copy link
Author

cytryn commented Feb 13, 2015

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

None of the tries worked =/

@hackiftekhar
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants