iOS 8 - UIPopoverPresentationController moving popover

后端 未结 6 1312
遇见更好的自我
遇见更好的自我 2020-12-25 13:40

I am looking for an effective way to re-position a popover using the new uipopoverpresentationcontroller. I have succesfully presented the popover, and now I want to move it

6条回答
  •  一向
    一向 (楼主)
    2020-12-25 14:13

    I'm posting this because I don't have enough points to vote or comment. :) @turbs's answer worked for me perfectly. It should be the accepted answer.

    Setting *rect to the rect you need in the delegate method:

    (void)popoverPresentationController:(UIPopoverPresentationController *)popoverPresentationController
        willRepositionPopoverToRect:(inout CGRect *)rect     
            inView:(inout UIView **)view
    

提交回复
热议问题