iphone - 当 iCarousel 包含 UITableView 作为 subview 时无法滑动

标签 iphone ios uitableview uigesturerecognizer icarousel

您好,我在我的应用程序中使用了 iCarousel,它将 UITableView 作为 subview 。当我尝试滑动或平移以显示下一个或上一个项目时,它不起作用。我认为 UITableView 的 手势识别器禁用了 iCarousel 的手势识别器。有很多这样的问题,但我看不到任何答案。附件是示例图片 enter image description here

请指导我解决这个问题。

代码

  _carousel =[[iCarousel alloc]initWithFrame:self.view.frame];
  _carousel.type = iCarouselTypeLinear;
  _carousel.pagingEnabled = YES;
  _carousel.delegate = self;
  _carousel.dataSource = self;
  [self.view addSubview:_carousel];

最佳答案

看起来你的旋转木马没有居中,这让我觉得它的边界可能是错误的。

默认情况下,iCarousel 没有启用 clipsToBounds,这意味着如果边界错误,您仍然会看到您的项目 View ,但可能无法与之交互。

尝试在 carousel 上启用 clipsToBounds,并将 backgroundColor 设置为类似红色的颜色,这样您就可以查看 carousel 尺寸是否正确。

如果不是,您可能需要调整自动调整大小或自动布局约束。

更新:

这实际上是 iCarousel 中的一个错误,与它用来确定滑动手势是否应被轮播拦截的启发式算法有关。已在 beta 7 中修复。

关于iphone - 当 iCarousel 包含 UITableView 作为 subview 时无法滑动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19486848/

相关文章:

html - 光标外的 iOS 11 Safari 引导模式文本区域

uitableview - UISearchDisplayController 动画重新加载数据

xcode - PickerView 加载 tableview 数据 Swift

iphone - 获取 URL 的文件名的函数

ios - 在 iOS swift 中存储大图片

ios - 解析,无法从 iOS 应用程序中删除 PFObject?

ios - Voiceover 如何决定 UITableView 关注哪个单元格?

iphone - 如何自动关闭UIActionSheet

iphone - C/Objective-c 中的二维数组

ios - 从 UITableViewCell 内的 UITextField 中删除 Tap 手势