gpt4 book ai didi

objective-c - 将 UITableView 上的水平滑动事件转发到父 View

转载 作者:搜寻专家 更新时间:2023-10-30 20:25:11 26 4
gpt4 key购买 nike

我有一个 UITableView,我想对点击和垂直滑动做出响应,但对于水平滑动仍然有类似 userInteractionEnabled = NO 的东西。我的意思是,它不会处理触摸并将触摸事件传递回其父 View 。

我试过但没有用的东西:

  • - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath

  • 中返回 NO
  • 覆盖 touchesBegan/touchesMoved/touchesEnded 并将事件传递给下一个响应者

  • 为水平滑动添加手势识别器并将 cancelsTouchesInView 设置为 YES

几周来我一直在尝试解决此问题,非常感谢您的帮助!

最佳答案

better you can subview empty view for tableview.view color should be empty and add gesture to that view.if gesture direction is vertical.scroll tableview

关于objective-c - 将 UITableView 上的水平滑动事件转发到父 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19748876/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com