问题描述
每个人都想在键盘弹出时移动 UITableView,但我正在寻找一种方法来禁用键盘弹出时对光标的自动动画.当键盘弹出并导致 UITableView 滚动到光标(以避免阻止它)时,我遇到了奇怪的抽搐/摇晃/不稳定的滚动行为.
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).
我的每个 UITableView 单元格中都有一个 UITextView.键盘弹出时我没有提交任何其他动画.
Each of my UITableView cells has a UITextView in it. I don't commit any other animations when the keyboard pops up.
此时,我想完全禁用动画并手动滚动到所需的 CGPoint.
At this point, I would like to disable the animation completely and manually scroll to a desired CGPoint.
谢谢!
推荐答案
自动滚动代码驻留在tableViewController中,所以不能禁用自动滚动.您可以从 UIViewController 子类化并在其中使用 tableView,而不是从 UITableViewController 子类化.如果你愿意使用 UITableViewController 本身,你可以重写 viewWillAppear 并且不要调用 [super viewWillAppear].
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 动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)