Ios 是否可以在uicollectionview中的自定义uicollectioncell中进行下拉刷新和加载更多内容?

Ios 是否可以在uicollectionview中的自定义uicollectioncell中进行下拉刷新和加载更多内容?,ios,Ios,Im尝试在集合视图中下拉刷新,但Im在集合视图中使用(tableview下拉刷新控制器)相同的代码。请任何人帮助解决我的问题。首先,您可以在viewDidLoad中编写以下代码:- - (void) viewDidLoad { [super viewDidLoad]; UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; refreshControl.tintColor = [UICol

Im尝试在集合视图中下拉刷新,但Im在集合视图中使用(tableview下拉刷新控制器)相同的代码。请任何人帮助解决我的问题。

首先,您可以在viewDidLoad中编写以下代码:-

- (void) viewDidLoad
{
    [super viewDidLoad];

    UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];

    refreshControl.tintColor = [UIColor blackColor];

    refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"];

    [refreshControl addTarget:self action:@selector(refreshControlAction) forControlEvents:UIControlEventValueChanged];

    [collectionView addSubview:refreshControl];
}

 Now add a target

- (void) refreshControlAction
{
    // Enter your code for request you are creating here when you pull the collectionView. When the request is completed then the collectionView go to its original position.
}

这与Xcode有什么关系?似乎是一个API问题,与所使用的IDE无关。您能提供一些代码吗?我使用EGORefreshTableHeaderView框架文件,谢谢您的回复。。当一次拉刷新加载时,如何在集合中创建一个空行。我要求在tableview中创建空行,以便在tableview底部显示加载视图。