开发者

how can I make a popover and arrow with presentPopoverFromRect?

开发者 https://www.devze.com 2023-01-02 22:22 出处:网络
I don\'t understand how t开发者_如何学编程o define the (CGRect)rect in order to control the position of popover, and the position of the arrow.

I don't understand how t开发者_如何学编程o define the (CGRect)rect in order to control the position of popover, and the position of the arrow.

For example, I have a 1004 x 768 view, how can I put the popover at lower right of the screen, and point the arrow at 700 (x) 1000 (y)?


Nickthedude is right about presentpopoverfromrect, but there is one essential moment with presentpopoverfromrect function: if you don't set popover's contentSizeForViewInPopover property it use defult values - 320*1100 points. And if you popover's rect doesn't fit into screen coordinates (with your coordinates got from the presentpopoverfromrect rect), system places your popover to rectangle which it considered as more optimal.


Cgrectmake(700,1000,10,10) and uipopoverarrowdirectionleft sorry I'm on my iPad so I can't write the exact code but pass those in as the arguments for your presentpopoverfromrect method. The only thing is i think you're too far to the right to put a popover there unless I'm not understanding your question.

0

精彩评论

暂无评论...
验证码 换一张
取 消