*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still
required after executing -layoutSubviews. UICollectionView's
implementation of -layoutSubviews needs to call super.'
This error has very useful information. Ensure that, in your collection view, you are calling layoutSubviews
on super
and there is no code after that.
- (void)layoutSubviews {
// Your Custom Code
[super layoutSubviews]; // No code after this and this is called last
}
You can try creating a custom UICollectionView
and enforcing call to layoutSubviews
on super
something like this:
@interface MyCollectionView : UICollectionView
@end
@implentation MyCollectionView
- (void)layoutSubviews {
// Your Custom Code
[super layoutSubviews];
}
@end
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…