简体   繁体   English

模态呈现的 TableViewController 抵抗滚动并且难以消除

[英]TableViewController presented modally resists scrolling and is difficult to dismiss

I have a TableViewController with dynamic cells which is presented modally via another tableview controller and it "resists" the drag gesture via which modals can be dismissed.我有一个带有动态单元格的 TableViewController,它通过另一个 tableview 控制器以模态呈现,它“抵抗”拖动手势,通过它可以解除模态。

I have tried activating user interaction for all prototype cells but with no result.我尝试为所有原型单元激活用户交互,但没有结果。

Have tried to test quickly with a mock static table and the drag gesture works as usual.尝试使用模拟静态表进行快速测试,拖动手势照常工作。

Can it be that the dynamic cells interfere with the gesture in some way?会不会是动态单元格以某种方式干扰了手势?

Is there some property which I may have changed in my dynamic tableview controller and which may affect the modal's ability to dismiss easily?是否有一些属性可能在我的动态 tableview 控制器中发生了更改,并且可能会影响模态轻松解除的能力?

I set up my tableview like this我像这样设置我的tableview

    self.tableView.separatorStyle = .none
    self.tableView.backgroundColor = .systemGray6
    self.tableView.alwaysBounceVertical = true

The culprit was found to be this line when I set up my TableViewController :当我设置TableViewController时,发现罪魁祸首是这一行:

self.tableView.alwaysBounceVertical = false

Apparently, disabling bouncing for the tableview kind of deactivates the drag gesture for the modal view.显然,禁用 tableview 的弹跳会禁用模态视图的拖动手势。

I set it to true and everything was working, although I think it should be possible to disable bounce and still be able to drag the modal down.我将它设置为 true 并且一切正常,尽管我认为应该可以禁用反弹并且仍然能够向下拖动模态。

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

相关问题 将UINavigationBar添加到以模态方式呈现的TableViewController中? - Add a UINavigationBar to a TableViewController presented modally? 以模态形式显示的TableViewController不会滚动到底部 - TableViewController presented modally does not scrolls to bottom Swift:无法取消模态显示的LoginViewController - Swift: Not able to dismiss modally presented LoginViewController 如何关闭以模态显示的UINavigationController? - How can I dismiss a UINavigationController presented modally? 更改选项卡时以模态显示的ViewController消失 - Dismiss ViewController presented modally when tab is changed 如何在模态呈现的 UITableView 上关闭 UITextView 上的键盘 - How to dismiss the keyboard on a UITextView on a modally presented UITableView 两个模态呈现的视图控制器-都关闭 - Two modally presented view controllers - dismiss both 我解散模态显示的viewController时,我的GameScene冻结 - My GameScene Freezes when i dismiss modally presented viewController 关闭从模态呈现的视图控制器翻转的视图控制器 - Dismiss view controller flipped from modally presented view controller 关闭以模态显示的视图使标签栏控制器(种类)重置 - Dismiss Modally presented view makes tab bar controller (kind of) reset
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM