gpt4 book ai didi

iOS : ScrollView delegate method inside of CollectionView not call

转载 作者:可可西里 更新时间:2023-11-01 03:30:24 24 4
gpt4 key购买 nike

首先我在.h文件中设置了delegate

@interface ViewController : UIViewController<UICollectionViewDataSource, UIScrollViewDelegate>

之后只需在collection view .m 文件中调用此方法

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{

NSLog(@"scrollViewDidScroll");
}

不调用这个方法。

最佳答案

简单一点

.m 文件中添加以下行

yourCollectionView.delegate = self;

及下方添加 .h

UICollectionViewDelegate

移除

UIScrollViewDelegate

关于iOS : ScrollView delegate method inside of CollectionView not call,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35917458/

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