How to make UIPopoverController keep same position after rotating?

前端 未结 13 1145
粉色の甜心
粉色の甜心 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:37

    I have similar problem which I resolve by this

    [myPop presentPopoverFromRect:myfield.frame inView:myscrollview permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    

    Where myfield is frame from which you want to show your popover and myscrollview is container view in which you add your popover as subview(in my case its my scrollview, instead of putting inView:self.view I use inView:myscrollview).

提交回复
热议问题