简体   繁体   English

didSelectItemAtIndexPath无法正常工作

[英]didSelectItemAtIndexPath doesn't work normally

I have a problem when tap an item into CollectionView. 将项目轻按到CollectionView时出现问题。

didSelectItemAtIndexPath doesn't called when tapped the item. 轻按该项时,didSelectItemAtIndexPath不被调用。 Only execute this method when hold the item. 仅在按住项目时执行此方法。

This is the method implementation. 这是方法的实现。

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath    *)indexPath {

  NSLog(@"did select at index path %@", indexPath);
  _magazine = [[AppController instance] magazines][indexPath.row];
  [self loadEditionsForMagazine:_magazine];
  _magazineEditionsView.hidden = NO;
}

My CollectionView is linked to the datasource and delegate. 我的CollectionView链接到数据源和委托。

Thanks. 谢谢。

Check these: 检查这些:

  1. Nothing is upon your UICollectionView . UICollectionView没有任何UICollectionView
  2. No subviews of UICollectionView receiving gesture before UICollectionView . 无子视图UICollectionView之前接收的手势UICollectionView
  3. Or there is no other gesture recognition active. 或者没有其他手势识别处于活动状态。

Hope this helps.. :) 希望这可以帮助.. :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 CollectionView didSelectItemAtIndexPath 不起作用 - Swift - CollectionView didSelectItemAtIndexPath doesn't work - Swift didSelectItemAtIndexPath在集合视图Swift中不起作用 - didSelectItemAtIndexPath Doesn't Work In Collection View Swift (快速)在外部视图中定义的UICollectionView中的didSelectItemAtIndexPath不起作用 - (Swift) didSelectItemAtIndexPath in UICollectionView defined in external view doesn't work UICollectionView selectItemAtIndexPath 不调用 didSelectItemAtIndexPath - UICollectionView selectItemAtIndexPath doesn't call didSelectItemAtIndexPath 斯威夫特:didSelectItemAtIndexpath函数不适用于json - Swift: didSelectItemAtIndexpath function not work of json 如果将轻按手势识别器添加到其背景视图,则不会调用iOS didSelectItemAtIndexPath - iOS didSelectItemAtIndexPath doesn't get called if a tap gesture recognizer is added to its background view 当superview具有手势时,collectionView没有调用didSelectItemAtIndexPath - collectionView didn't call didSelectItemAtIndexPath when superview has gesture 条件不起作用 - Condition doesn't work NSLocalizedStringFromTable不起作用 - NSLocalizedStringFromTable doesn't work watchValueForKeyPath不起作用 - observeValueForKeyPath doesn't work
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM