4 Replies
      Latest reply on Feb 1, 2018 12:42 AM by CharlesChwang
      CharlesChwang Level 1 Level 1 (0 points)

        When the screen orientation changed, the UIPanPressGestureRecognizer state will always be changed to UIGestureRecognizerStateCancelled and make this gesture invalid.

          Of course i shoud show the code, but i think this code is too short so it can not be the key of this problem.I'll try to describe it as best I can.

          Think about it: A UIScrollView in a APP and this APP allow landscape mode, now you are dragging this UIScrollView and rotate your iPhone screen to landscape at the same time, remember you are always keeping your finger pressing in the screen, then you will see that your dragging is cancelled when the rotate animation of the UIScrollView is showing, but now your finger is still pressing in that screen.

          Then i found those gestures in the Photos didn't, when i was dragging the listview of photos(i think it is a UICollectionView) and rotated my iPhone, the screen orientation will no be changed Immediately unless i stopped my dragging.

          1.enabled the switch of screen rotation and launch the Photos

          2.rotated the screen to landscape and now views were not be rotated

          3.left finger from the screen

          So how can we do to freeze the screen rotating until get our finger out of the screen.

          Is there any way of avoiding this? Or is there some other approach of doing it?Thank you very much!