problem in setting PopoverContentSize

后端 未结 5 879
醉酒成梦
醉酒成梦 2021-01-14 12:41

I am not able to set the contentsize with size(650,400).But even i create popoverController with same width & height it is getting created.

No idea what is worry

5条回答
  •  死守一世寂寞
    2021-01-14 12:50

    I was having a similar problem in that I was unable to change the size of a popover controller during device rotation. I found the information that lead to my solution in a answer to a similar question.

    Because I was presenting the popover from a Bar button, UIKit was "trying" to help by adjusting the size of the popover during rotation (because the position of the button might be different after a change to a different device orientation). Even though I knew exactly what size I wanted the popover to be in every case, it wasn't respecting my calls to setPopoverContentSize. My solution was to dismiss the popover in willAnimateRotationToInterfaceOrientation, then re-present the same popover in didRotateFromInterfaceOrientation after setting appropriate values for both contentSizeForViewInPopover and popoverContentSize. IHTH

提交回复
热议问题