How to add SearchBar in CollectionView? [closed]

2019-08-27 00:05发布

Trying to add a header SearchBar CollectionView, but get an error:

Illegal Configuration: Connection "searchBar" cannot have a prototype object as its destination.

2条回答
甜甜的少女心
2楼-- · 2019-08-27 00:27

arrange your view like this

arrange your view like this, and its related delegate methods.

查看更多
We Are One
3楼-- · 2019-08-27 00:35

Try to add the "searchBar" above the collection view not upon the header of the collection view. Think if the collectionView has multiple sections, it will definitely cause a problem while scrolling the collectionView, hence you need to add the searchBar just above the collectionView not upon it's header.

查看更多
登录 后发表回答