[英]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
并且tableview
有section 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
的通常情况,但是我在viewcontroller
有tableview
!
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.