简体   繁体   English

滚动视图中的UITableView和UICollectionView不可见

[英]UITableView And UICollectionView inside scrollView not visible

I have a tableView and a collectionView inside scrollView. 我在scrollView中有一个tableView和一个collectionView。 Both of them have constraints for left, right, top and bottom. 他们两个都有左,右,上和下的约束。 But both views are now visible when inside scrollView 但是,现在在scrollView中时,两个视图都可见

Why may it be ? 为什么会这样呢?

我认为scrollViews需要知道其子视图的宽度和高度

Follow these steps: 跟着这些步骤:

  1. Disable scroll for table view and collection view. 禁用表视图和集合视图的滚动。
  2. Resize the height of table view and collection view as per its content (If Dynamic height) 根据内容(如果动态高度)调整表视图和集合视图的高度

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM