VLeonovs
VLeonovs

Reputation: 2251

TableView and CollectionView in one ViewContoroller

I have UITableView and UICollectionView in one ViewController.

If CollectionView is below the TableView in a hierarchy, the scrolling and clicking work only for CollectionView but for TableView all interactions are not working at all and vice verse...

On the screen, there is only one visible element TableView or CollectionView, and it's controlled by isHidden = true/false

What is wrong have I missed? How to have both TableView and CollectionView scrollable/clickable and manage that which is visible on the screen?

Upvotes: 0

Views: 49

Answers (1)

Shehata Gamal
Shehata Gamal

Reputation: 100523

You need to manage isHidden for containers like

container1.isHidden = true / false
container2.isHidden = true / false

tableView/collectionView are just subviews of their containers so hiding/unhiding them doesn't make the ability to interact with back-most one

Upvotes: 2

Related Questions