我有一个UITableView与4 UITableViewCell里面。我希望它通过设置是动态的:UITableView与嵌入UICollectionView不工作
tableView.estimatedRowHeight = 44
tableView.rowHeight = UITableViewAutomaticDimension
对于第三单元,采用内嵌式UICollectionView,它有20 UICollectionViewCell。
当我跑我的项目中,uicollectionviewcell回报(44,44),它显示这些错误:
The behavior of the UICollectionViewFlowLayout is not defined because:
the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x7fe028c25bd0>, and it is attached to <UICollectionView: 0x7fe029884800; frame = (20 0; 335 44); clipsToBounds = YES; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x60000024bbb0>; layer = <CALayer: 0x6000002269c0>; contentOffset: {0, 0}; contentSize: {0, 44}> collection view layout: <UICollectionViewFlowLayout: 0x7fe028c25bd0>.
Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
感谢进步。
什么问题? – Krumelur