我有一个UICollectionView和一个包含UITextView的Cell。我希望单元格的大小取决于TextView的高度(这样就不需要滚动并且所有文本始终可见)。我正在尝试这个:funccollectionView(collectionView:UICollectionView,layoutcollectionViewLayout:UICollectionViewLayout,sizeForItemAtIndexPathindexPath:NSIndexPath)->CGSize{if(indexPath.row然而它并没有真正起作用。有时高度太大,有时太小,我仍然需要滚动。