iOS 8 GM does not update constraints on collection views

后端 未结 4 1580
小鲜肉
小鲜肉 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:37

    in my UICollectionViewCell class I added

    override func layoutSubviews() {
        contentView.frame = bounds
        super.layoutSubviews()
    }
    

    and I used this code to refresh

    dispatch_async(dispatch_get_main_queue(), { () -> Void in
        // in this case vController is UICollectionView
        self.vController.reloadData()
        self.vController.layoutSubviews()
    })
    

提交回复
热议问题