gpt4 book ai didi

ios - didSelectItemAtIndexPath 没有在 ios swift 中调用

转载 作者:可可西里 更新时间:2023-10-31 23:44:24 26 4
gpt4 key购买 nike

当我只是选择/点击项目时,didSelectItemAtIndexPath 方法没有被调用。但是当我长按项目然后 didSelectItemAtIndexPath 时,它正在完美地调用工作。为什么会这样。我应该做错什么?

我添加了collection view如下

collectionview_followers.frame = CGRectMake(0, 50, SCREEN_WIDTH, 150)

    collectionview_followers.delegate = self

collectionview_followers.dataSource = self

collectionview_followers.registerClass(UICollectionViewCell.self, forCellWithReuseIdentifier: "FollowersCell")

collectionview_followers.backgroundColor = UIColor.clearColor()

collectionview_followers.userInteractionEnabled = true

collectionview_followers.allowsSelection = true

view_collectionviewBG.addSubview(collectionview_followers)

单元格包含带有图像和标签的 uiview

最佳答案

确保在 super.ViewDidLoad() 之前的 viewDidLoad 方法中设置 self.tableView.allowsSelection = true

关于ios - didSelectItemAtIndexPath 没有在 ios swift 中调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34014481/

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