旋转 UIPanGestureRecognizer?
这里有一个应用程序,我使用 AirPlay 在电视上显示 UIScrollView,并且我将其 UIPanGestureRecognizer(滚动手势)添加到 iPad 上我自己的自定义视图中。效果非常好,我可以通过触摸本地视图来滚动电视上的 UIScrollView。
但是,一旦旋转 iPad,我就会遇到问题。由于电视上的视图不旋转,因此手势也不旋转。这意味着在我的本地视图上平移现在变成了电视上 UIScrollView 上的向左(或向右)。
到目前为止,我已经尝试在旋转之前删除手势,然后将其添加回来,看看这是否有帮助,但在横向模式下它仍然停留在侧面。我也不想创建自己的平移手势,因为它不会像滚动视图中内置的那样平滑。
这里有人对如何进行这项工作有什么建议吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论