简体   繁体   English

如何滚动到放置在UITableView中的UITextField

[英]How to scroll to UITextField placed into a UITableView

I've got an UIScrollView with an UIImageView at the top and an UITableView. 我有一个UIScrollView和一个UIImageView在顶部,UIImageView在顶部。

inside every cell of the UITableView I've placed a UITextField 在UITableView的每个单元格中,我放置了一个UITextField

I would like to know how I can automatically scroll to the UITextField selected so that it doesn't go under the keyboard 我想知道如何自动滚动到所选的UITextField,以使其不会进入键盘下方

I've already looked at this Get UITableView to scroll to the selected UITextField and Avoid Being Hidden by Keyboard but it doesn't works very well for my situation.. 我已经查看过此Get UITableView可以滚动到选定的UITextField并避免被键盘隐藏,但是对于我的情况,它并不是很好。

could you help me? 你可以帮帮我吗?

Thank You! 谢谢!

Check out Matt Gallagher's fantastic Sliding UITextFields around to avoid the keyboard . 看看Matt Gallagher出色的Sliding UITextFields来避免键盘 It ought to be just what you need. 它应该正是您所需要的。 You can modify it to only scroll a specific element, or just leave it as is to scroll the whole superview. 您可以对其进行修改以仅滚动特定元素,或者仅将其保留以滚动整个父视图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM