自动旋转时 UIPopOverController 问题
我正在使用 PresentPopOverFromRect: 方法呈现一个 UIPopovercontroller。在纵向方向。当我自动旋转到横向时,UIPopoverController 未出现在正确的位置。如何在自动旋转设备时定位 UIPopoverController。
I am presenting a UIPopovercontroller using PresentPopOverFromRect: method. in Portrait Orientation. When i autorotate to Landscape UIPopoverController is not presenting at the proper position. How to position the UIPopoverController while autorotating the device.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要重写此函数:
您可以在其中根据当前方向更改 UIPopovercontroller 的尺寸和位置。该函数很方便,因为它是在屏幕重绘之前和用户界面开始旋转之前调用的。
您应该查看此教程以了解您应该如何处理iPad 不同方向的布局。
You need to override this function:
where you can change the dimension and position of the UIPopovercontroller depending of your current orientation. This function is convenient because it is called just before the screen is being redrawn and just before the user interface begins to rotate.
You should check this tutorial for an understanding of how you should handle the layout for different orientations of the IPad.
是的,正如 tiguero 所说,在您的自定义 UIViewController 中,您可以重写该方法:
您可以尝试一下!
Yes, as tiguero says, in your custom UIViewController, you can override the method:
You can have a try!