2

Have an app here where I have a UIScrollView being displayed on the TV using AirPlay, and I'm taking its UIPanGestureRecognizer (scroll gesture) and adding it to my own custom view on the iPad. Works wonderfully, and I can scroll the UIScrollView on the TV by touching my local view.

However, I have problems once I rotate the iPad. Since the view on the TV isn't rotating, the gesture doesn't rotate either. Meaning that panning up on my local view now becomes left (or right) on the UIScrollView on the TV.

So far I've tried removing the gesture before the rotation, and then adding it back in afterwards to see if that would help, but it's still stuck on being sideways when in landscape mode. I also don't want to create my own pan gesture as it wouldn't be as smooth as the one built into the scrollview.

Anybody here have any suggestions as to how to make this work?

Christian A. Strømmen
  • 3,181
  • 2
  • 25
  • 46
  • 1. Thank you, fixed it now. 2. I'm not sure what you're referring to. I am subclassing UIViewController in both the controller for the scrollview, and the controller for my own view. And I'm getting the pan gesture from the pan gesture property of uiscrollview. – Christian A. Strømmen Nov 25 '11 at 05:07
  • 1
    I ask because when one subclasses UIViewController, one gets autorotation of everything (including gestures) for free. – CodaFi Nov 25 '11 at 05:51
  • I probably didn't explain it properly. :) The view controller that belongs to webview isn't actually rotated, and the gesture belonging to the scrollview therefor doesn't get rotated even though I added it to my view (the one that does get rotated). – Christian A. Strømmen Nov 25 '11 at 06:36
  • A little bit of code would be nice. Post... the rotation code, web view, and wherever you create the pan gesture. – CodaFi Nov 25 '11 at 06:54
  • I don't create the pan gesture. The pan gesture is the one that the UIScrollView comes with. If it helps, this is what I'm doing: `UIPanGestureRecognizer *scrollGesture = scrollView.panGestureRecognizer; [touchView addGestureRecognizer:scrollGesture];` I have no rotation code, because I don't know how I can rotate the scrollGesture itself. And as far as I know you can't really force a view controller (in this case the one belonging to the UIScrollView) to rotate (not that I would want it to rotate on the TV). I'm sorry if I'm not being clear here. :) – Christian A. Strømmen Nov 25 '11 at 06:58

0 Answers0