iOS 8 GM不会更新集合视图的限制 [英] iOS 8 GM does not update constraints on collection views
问题描述
在Xcode 6 Beta 7及其之前的所有版本中,我有一个集合视图,当iPad在横向和纵向之间旋转时,它会更新其对单元格的约束。现在,它根本不更新,实际上它看起来就像我把它留在XIB,这意味着,它不是更新。看来,我使用的可重复使用的视图正在更新正确,但细胞肯定不是。
In Xcode 6 Beta 7 and all versions before it, I had a collection view that would update its constraints on its cells when an iPad would rotate between landscape and portrait. Now, it doesn't update at all, and in fact it looks exactly like how I leave it in the XIB, which implies to me that it's not updating at all. It appears that the reusable views I'm using are updating correctly, but the cells certainly are not.
还有其他人遇到这个问题吗?
Has anyone else run into this issue yet? Anyone have any ideas for how to get past it?
我正在使用iOS 7.1模拟器。
I'm using the iOS 7.1 simulator.
推荐答案
您需要创建一个UICollectionViewCell的子类,并将该子类作为所有单元格的超类。
You need to make a subclass of UICollectionViewCell and make that subclass as the superclass of ALL of your cells.
示例: p>
Example:
@interface MDTCollectionViewCell : UICollectionViewCell
@end
@implementation MDTCollectionViewCell
- (void)setBounds:(CGRect)bounds {
[super setBounds:bounds];
self.contentView.frame = bounds;
}
@end
这篇关于iOS 8 GM不会更新集合视图的限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!