在 willAnimateFirstHalfOfRotationToInterfaceOrientation:duration 中获取旋转视图的矩形:
我试图通过挂钩 UIViewController 中的各种自动旋转方法来在纵向和横向之间设置动画。由于我的视图层次结构的一些微妙之处,我想在动画的前半部分设置子 UIScrollView
的框架,然后在后半部分滚动到位。这需要从 willAnimateFirstHalfOfRotationToInterfaceOrientation:duration:
中了解视图的最终旋转帧。
系统必须知道该帧才能执行旋转动画,但 UIViewController 是否可以访问它?代码> 子类?如果没有,我唯一的选择是对旋转框架进行硬编码或在 didRotateFromInterfaceOrientation...
中执行所有布局吗?
谢谢。
I am trying to animate between portrait and landscape orientations by hooking the various autorotation methods in UIViewController
. Due to some subtleties of my view hierarchy, I'd like to set the frame of a child UIScrollView
in the first half the animation and then scroll into position during the second half. This requires knowledge of the final, rotated frame of my view from within willAnimateFirstHalfOfRotationToInterfaceOrientation:duration:
The system must know this frame in order to perform the rotation animation, but is it accessible to UIViewController
subclasses? If not, are my only options to hardcode the rotated frame or perform all layout in didRotateFromInterfaceOrientation...
?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知何故忽略了 willAnimateRotationToInterfaceOrientation:duration: 回调。这解决了我的问题,揭示了更多问题。如果其他人想详细说明两部分旋转动画,我将保留这个问题。编辑:关闭,因为已经好几天没有人了。
I somehow managed to overlook the
willAnimateRotationToInterfaceOrientation:duration:
callback. This resolved my issue, revealing a handful more. I will leave the question open in case someone else would like to elaborate on two-part rotation animation. EDIT: Closing, since no takers for days.