Swift viewWillTransition not called

后端 未结 4 885
伪装坚强ぢ
伪装坚强ぢ 2020-12-20 16:27

I\'m creating a full screen image gallery using a UICollectionView. When the user rotates the device, I perform updates to the UICollectionView wit

4条回答
  •  臣服心动
    2020-12-20 17:02

    I replaced

    func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator)
    

    by

    func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator)
    

    and it works for me.

提交回复
热议问题