【发布时间】:2019-03-05 23:35:51
【问题描述】:
我有一个顶部有一个 tabBar 的视图,下面是一个 tableView。 tableView 具有受限于它的触摸手势(点击、双击和平移手势)。但是,tabBar 没有安装触摸手势,只响应长按触摸。
一些有用的信息: - tabBar 委托被设置为 self
只有tabBar代码:
func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
if item.tag == 101 { //tag number of first tab bar item
print("tableView")
}
if item.tag == 102 { //tag number of second tab bar item
print("collectionView") //going to add collection view eventually
}
}
任何帮助将不胜感激。谢谢!
【问题讨论】:
-
tableView 是否在标签栏下方向上延伸?顺便说一句,tab bar一般都在view的底部,你的意思是navigationController吗?
-
@Magnas 我有一个隐藏在表格视图标题中的搜索栏,当我在表格视图上向下滑动时它会延伸出来,所以我猜它位于标签栏下方?一般来说,是的,标签栏确实位于底部,但我在屏幕顶部附近添加了一个,类似于 instagram 在个人资料页面上在网格视图和单滚动视图之间切换的方式。