9

这个想法是在 UICollectionView 中有一个搜索视图,并且仍然能够使用拉来刷新 UIRefreshControl。在用户向下滚动 UICollectionView 之前,搜索和 UIRefreshControl 将不可见。

------------------
| Pull To Refresh |
------------------
|      Search     |
------------------    <--- Above of this line the content is hidden
|    A   |   B    |
------------------
|    C   |   D    |
------------------
|     Footer      |
------------------

我已经尝试将 SearchView 实现到 UICollectionView 的部分标题中,但是这样我不能在集合视图的单元格是第一响应者时使用 reloadData。

一个好的解决方案应该能够:

  • 在用户输入搜索框时更新 CollectionView 数据源
  • 不要乱用 UIRefreshControl 的动画
4

1 回答 1

-3

使用 scrollView 而不是处理 CollectionView。对于拉动刷新功能,您可以使用开源作为https://github.com/kenzan8000/PullRefreshView

于 2013-09-04T18:31:51.890 回答