简体   繁体   English

当出现键盘并且相应的文本字段位于tableview的节标题中时,停止自动滚动table view

[英]Stop auto scrolling of table view when keyboard appears and respective textfield was in tableview's section header

I have tableview inside viewcontroller (xib) and tableview has section header and header view contains a textfield . 我在viewcontroller (xib)内部有tableview并且tableviewsection header和标题视图包含一个textfield If I scroll tableview manually and then open or hide keyboard (I mean click text field) then tableview automatically scrolls up and down respectively. 如果我手动滚动tableview ,然后打开或隐藏键盘(我的意思是单击文本字段),则tableview分别自动向上和向下滚动。 It only happens when the textfield is in section header view . 仅当文本字段位于section header view时才会发生。 If I put the textfield outside of the header view(section header) then it is not happening. 如果我将文本字段放在header view(section header) ,则不会发生。

So, I want to stop that autoscrolling of tableview! 因此, 我想停止autoscrolling tableview!

I have checked many solutions, but none is working! 我已经检查了许多解决方案,但是没有一个在起作用!

I have found that this is the usual case for tableviewController but I have tableview in viewcontroller ! 我发现这是tableviewController的通常情况,但是我在viewcontrollertableview

If any body can help! 如果有身体可以帮忙! thanks :) 谢谢 :)

This was the issue of IQKeyboardManager library. 这是IQKeyboardManager库的问题。 It scrolls tableview when textfield of header becomes firstresponder. 当标头的文本字段成为第一响应者时,滚动tableview。

I have disable IQKeyboardManager manager for current class as solution like below, 我为当前类禁用了IQKeyboardManager管理器,如下所示,

  [[IQKeyboardManager sharedManager] setEnable:NO];

and when leave current class I have again enable IQKeyboardManager like, 当离开当前类时,我再次启用了IQKeyboardManager

   [[IQKeyboardManager sharedManager] setEnable:YES];

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

相关问题 当键盘出现时如何阻止tableView外部的标题消失 - How to stop header outside of tableView from disappearing when keyboard appears 出现键盘时的滚动视图:库还是DIY? - Scrolling view when keyboard appears: Library or DIY? 出现键盘时 UITableViewController 不滚动视图 - UITableViewController not scrolling view when keyboard appears 如何在表格视图中解除表格视图节标题的固定 - How to unfix tableview section header in table view 当键盘出现并启用滚动时,TextField向上移动 - TextField moves up when keyboard appears and scrolling enabled 出现键盘时移动具有自动布局约束的文本字段 - Moving a textfield with auto layout constraints when the keyboard appears 滚动tableView节的页脚和页眉 - Scrolling tableView section footer and header 为什么tableview部分标题视图出现在表标题视图上? - Why are tableview section header views appearing over the table header view? 自定义表格视图单元格中的文本字段从初始文本字段中消失,并在滚动时显示在其他单元格文本字段中 - Textfield in Custom Table View Cell dissappears from initial textfield and appears in other cells textfield upon scrolling 使用keyboard_actions包flutter出现键盘时TextField缩小/滚动 - TextField shrinking/scrolling when keyboard appears using keyboard_actions package flutter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM