How to make UIPopoverController keep same position after rotating?

前端 未结 13 1141
粉色の甜心
粉色の甜心 2021-01-30 18:21

I can\'t keep popover the same position on the screen after rotation. Is there any good way to do that, because just setting some frame to popover works terrible after rotating.

13条回答
  •  死守一世寂寞
    2021-01-30 18:44

    In iOS 7 you can use - (void)popoverController:(UIPopoverController *)popoverController willRepositionPopoverToRect:(inout CGRect *)rect inView:(inout UIView *__autoreleasing *)view to reposition your UIPopoverController's view on interface orientation change.

    See the UIPopoverControllerDelegate documentation.

提交回复
热议问题