swift4 - swift4 UISwipeGestureRecognizer Viewcontroller 带有大标题和单元格不起作用
问题描述
我有一个ViewController
大标题。在我ViewController
的是 2 个单元格。UISwipeGestureRecognizer
向下滑动不起作用。我想searchController
在 titleView 中使用此滑动操作调用 a。原因可能是大标题吗?(向下滑动标题会下降并变得更大,没关系)。但是我的滑动动作将不会被识别。有任何想法吗?
我的代码: -viewDidLoad()
在 ViewController中调用的函数
func swipeSetup() {
let swipeDown = UISwipeGestureRecognizer(target: self, action: #selector(funcSwipedDown(sender:)))
swipeDown.direction = .down
self.view.addGestureRecognizer(swipeDown)
}
@objc func funcSwipedDown(sender: UISwipeGestureRecognizer){
Utils.displayAlert(title: "Info", message: "swipe down")
self.addNavigationbar() // func for adding search bar
}
解决方案
推荐阅读
- sql - 为nodejs访问JSON中的元素
- javascript - 如何将动态输入值添加到本地状态以进行检索
- c++ - 同时从服务器发送和接收
- android - 如何创建一个多对多数据库模式,同时保持关联项目的顺序?
- c - C 函数返回 0,即使调试器显示它返回 1
- r - 如何找到标准误差在正态分布中的特定数量的概率?
- database - Lando db-import 导入数据库需要很长时间
- r - 从具有不同列名的表列表中创建数据框
- react-native - Connect() 在 Redux React Native 应用程序中不起作用(没有错误)
- algorithm - 当我想要有效地搜索所有区域时,什么是用于存储矩形的好数据结构至少包含给定的大小