【发布时间】:2016-09-14 11:12:00
【问题描述】:
我有一个 UITableView,里面有 4 个 UITableViewCell。我希望它是动态的设置:
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.
提前致谢。
【问题讨论】:
-
有什么问题?
标签: ios objective-c uitableview uicollectionview