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

UITextField in subview keep being hidden by the keyboard #124

Closed
BoilingLime opened this issue Nov 27, 2014 · 3 comments
Closed

UITextField in subview keep being hidden by the keyboard #124

BoilingLime opened this issue Nov 27, 2014 · 3 comments
Assignees
Labels

Comments

@BoilingLime
Copy link

I put two UITextField in a subview to be able to perform action on both UITextField. But the keyboard keep to overlay the view and to hide the text fields.

This is a link to a video of the issue :
https://www.youtube.com/watch?v=WBGBayq35R8&feature=youtu.be

Or could it be the auto layout constraints which messing up everything ?

@hackiftekhar
Copy link
Owner

This may be autolayout, but In my knowledge, the library is not depend on autolayout or autoresizing. It works in both configuration. So could you please share a demo project so I'll be able to debug the issue and update the library accordingly.

@BoilingLime
Copy link
Author

Here is a demo project where you can test the bug :
https://www.dropbox.com/s/en174cnhtpnv63f/DemoForIQKeyborad.zip?dl=0

@hackiftekhar hackiftekhar added Invalid and removed Bug labels Nov 28, 2014
@hackiftekhar
Copy link
Owner

I found that IQKeyboardManager is doing his work perfectly, but your auto layout configuration is incorrect.

Issue:-
I found that the logo UIImageView’s top is pinned with topLayoutGuide.

When the MyViewController.view’s frame is updated by IQKeyboardManager, for example frame is updated from (0,0,320,568) to (0,-82,320,568) to show textField properly, then the UIImageView’s top forces self to not move and keep 38 distance with topLayoutGuide, and UIImageView also forces the bottom UIView to move down(Bottom UIView's top is pinned with UIImageView's bottom) . So the result is shown like buggy animation with NO change in screen, althought main view is moved upside but all it’s content is moved downside.

Solution:-
You can remove UIImageView’s top pinned with topLayoutGuide and pin it with it’s superView.

Guide to AutoLayout:-
For proper understanding and use of topLayoutGuide please refer this guide.

http://www.doubleencore.com/2013/12/reconciling-ios-6-ios-7-using-interface-builder/

Thanks
Iftekhar

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