【问题标题】:Swift cant use hidesBarsOnSwipe because of embedded table view由于嵌入式表格视图,Swift 无法使用 hidesBarsOnSwipe
【发布时间】:2015-08-06 22:32:21
【问题描述】:

在我的 VC 中,我有一个包含嵌入式表格视图的容器视图。

我现在的问题是我不能使用navigationController?.hidesBarsOnSwipe = true

在我的 VC 中,因为它不会从嵌入式表格视图中选择滑动。我也尝试在我的表视图 VC 中设置 hidesBarsOnSwipe = true,但在 VC1 中无法捕捉到。

我还尝试在我的表格视图中进行删除,一旦我向上或向下滚动然后我隐藏导航栏就会触发。但问题是我无法让它保持隐藏或可见,因为滚动具有弹跳效果/拉动刷新=自弹跳以来将连续隐藏/显示我的导航栏几次。而且我不想移除反弹效果。

那么有没有办法在嵌入式表格视图中检测navigationController?.hidesBarsOnSwipe = true

【问题讨论】:

标签: ios swift


【解决方案1】:

您可以添加一个手势识别器,并在其委托中在名为 func gestureRecognizer(UIGestureRecognizer, shouldRecognizeSimultaneouslyWith: UIGestureRecognizer) -> Bool 的方法中返回 true 以使 tableView 与 GestureRecognizer 一起工作。之后,您可以随时通过滑动来隐藏或显示导航栏。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-11
    • 2017-06-01
    • 1970-01-01
    • 2018-07-19
    • 2013-12-10
    相关资源
    最近更新 更多