Swift viewWillTransition not called

后端 未结 4 878
伪装坚强ぢ
伪装坚强ぢ 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 16:57

    This is how I fixed that:

    Go to Project Target - General - Deployment Info

    Tick Device Orientations the app supports

    Also you need (change UIInterfaceOrientationMask.all for whatever is appropriate):

    override var supportedInterfaceOrientations : UIInterfaceOrientationMask {
        get {
            return UIInterfaceOrientationMask.all;
        }
    }
    

    for ViewController.

提交回复
热议问题