iOS 8 GM does not update constraints on collection views

后端 未结 4 1585
小鲜肉
小鲜肉 2021-02-13 09:57

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. No

4条回答
  •  梦谈多话
    2021-02-13 10:33

    You need to make a subclass of UICollectionViewCell and make that subclass as the superclass of ALL of your cells.

    Example:

    @interface MDTCollectionViewCell : UICollectionViewCell
    @end
    
    @implementation MDTCollectionViewCell
    
    - (void)setBounds:(CGRect)bounds {
        [super setBounds:bounds];
        self.contentView.frame = bounds;
    }
    
    @end
    

提交回复
热议问题