Ios 禁用表视图滚动
问题是: 我在现有的tableview控制器E的基础上展示了一个popover tableview控制器p 我遇到的问题是E仍然滚动。也就是说,如果你滚动到P的边界之外,E将滚动,P将作为E的一部分Ios 禁用表视图滚动,ios,uitableview,uiscrollview,Ios,Uitableview,Uiscrollview,问题是: 我在现有的tableview控制器E的基础上展示了一个popover tableview控制器p 我遇到的问题是E仍然滚动。也就是说,如果你滚动到P的边界之外,E将滚动,P将作为E的一部分 当显示p时,如何禁用E滚动?当显示p时,设置: yourTableView.isScrolEnabled=false 当您关闭popover时: yourTableView.isCrollenabled=true 注意:关闭popover时,可能需要使用协议再次启用滚动。 为此,我将添加您的popo
当显示p时,如何禁用E滚动?当显示p时,设置:
yourTableView.isScrolEnabled=false
当您关闭popover时:
yourTableView.isCrollenabled=true
注意:关闭popover时,可能需要使用协议再次启用滚动。
为此,我将添加您的popover视图控制器:
protocol ProtocolPopOver{
func enableScrollAgain();
}
var delegatePopOver:ProtoclPopOver?
self.dismiss(animated: true, completion: { delegatePopOver.enableScrollAgain() })
class yourclass: UIViewController, ProtocolPopOver{...
然后,在该视图控制器中:
protocol ProtocolPopOver{
func enableScrollAgain();
}
var delegatePopOver:ProtoclPopOver?
self.dismiss(animated: true, completion: { delegatePopOver.enableScrollAgain() })
class yourclass: UIViewController, ProtocolPopOver{...
当您关闭viewController时:
protocol ProtocolPopOver{
func enableScrollAgain();
}
var delegatePopOver:ProtoclPopOver?
self.dismiss(animated: true, completion: { delegatePopOver.enableScrollAgain() })
class yourclass: UIViewController, ProtocolPopOver{...
在主视图控制器中,显示popover时,添加:
popoverViewController.delegatePopOver = self
在UIViewController附近实施协议:
protocol ProtocolPopOver{
func enableScrollAgain();
}
var delegatePopOver:ProtoclPopOver?
self.dismiss(animated: true, completion: { delegatePopOver.enableScrollAgain() })
class yourclass: UIViewController, ProtocolPopOver{...
并添加以下功能:
func enableScrollAgain(){
yourTableView.isScrollEnable = true
}