iOS:键盘显示时禁用UITableView动画 [英] iOS: Disable UITableView animation when keyboard shows up

查看:178
本文介绍了iOS:键盘显示时禁用UITableView动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当键盘弹出时,每个人都想移动UITableView,但我正在寻找一种方法来在键盘弹出时禁用光标的自动动画。当键盘弹出并导致UITableView滚动到光标(以避免阻塞它)时,我遇到奇怪的抽搐/颠簸/不稳定的滚动行为。



每个我的UITableView单元格中有一个UITextView。当键盘弹出时,我不会提交任何其他动画。



此时,我想完全禁用动画并手动滚动到所需的CGPoint。 / p>

谢谢!

解决方案

自动滚动代码驻留在tableViewController中,所以无法禁用自动滚动。您可以从UIViewController继承子类并在其中使用tableView,而不是从UITableViewController继承子类。
如果你愿意使用UITableViewController本身,你可以覆盖viewWillAppear而不要调用[super viewWillAppear]。


Everyone wants to move the UITableView when the keyboard pops up, but I'm looking for a way to disable the automatic animation to the cursor when the keyboard pops up. I'm experiencing an odd jerking / jolting / erratic scrolling behavior when the keyboard pops up and causes the UITableView to scroll to the cursor (to avoid blocking it).

Each of my UITableView cells has a UITextView in it. I don't commit any other animations when the keyboard pops up.

At this point, I would like to disable the animation completely and manually scroll to a desired CGPoint.

Thank you!

解决方案

The automatic scrolling code resides in tableViewController, so auto-scrolling can't be disabled. Instead of subclassing from UITableViewController you can subclass from UIViewController and use a tableView inside it. If you are willing to use UITableViewController itself, you can override viewWillAppear and don't call [super viewWillAppear].

这篇关于iOS:键盘显示时禁用UITableView动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆