popover 基本原理 http://blog.csdn.net/chun799/article/details/6988359
open source popover "WEPopover" 也是通过这个原理做的
基本使用方法:
http://www.raywenderlich.com/1056/ipad-for-iphone-developers-101-uipopovercontroller-tutorial
http://blog.csdn.net/lingedeng/article/details/6781385
http://hi.baidu.com/bunsman/blog/item/3eca7a01101fcb19738da597.html
http://xyyk.iteye.com/blog/838038
注意:
1. 若要显示不带箭头的popover,则设置permittedArrowDirections参数为0
2. 设置popover显示的view的大小,则应该在包在popover的view controller的didLoad里添加下列代码:
self.contentSizeForViewInPopover=CGSizeMake(320,250);
除了在包在popover里的view controller里设置窗口大小,还可以设置popover controller的popoverContentSize属性来设置窗口的大小。下面是contentSizeForViewInPopover和contentSizeForViewInPopover的官方文档 (ref link)
contentSizeForViewInPopover
The size of the view controller’s view while displayed in a popover.
The recommended width for popovers is 320 points. If needed, you can return a width value as large as600 points, but doing so is not recommended.
If the popover controller displaying the view controller sets its popoverContentSize
property, the popover controller overrides the values set in the view controller’s contentSizeForViewInPopover
property.
3. 如果你的popover里是一个navigation controller,第一个view和第二个view的contentSizeForViewInPopover设置的高度不同,那么当从高度短的view切换到 高度长的view,就会拉长popover的高度,但从高度长的view切换到 高度短的view,popover的高度却不会缩短。
解决方法有2(都没试):
http://stackoverflow.com/questions/2738887/how-to-change-height-of-the-popovercontroller-when-one-of-its-viewcontrollers-ge
http://stackoverflow.com/questions/2752394/popover-with-embedded-navigation-controller-doesnt-respect-size-on-back-nav
http://stackoverflow.com/questions/7642958/uipopovercontroller-height-grows-never-shrinks
所以尽可能不要改变popover的高度
一个能用于iphone的popover https://github.com/werner77/WEPopover
another popover https://github.com/50pixels/FPPopover
http://www.zhixing123.cn/jiaocheng/UIPopoverController.html
http://afantihust.blog.51cto.com/2231549/533940
关于popover使得app被拒的情况:
* 不能同时出现多个popover
http://stackoverflow.com/questions/8922615/ipad-how-to-handle-multiple-popovers-regarding-human-guidelines
* popover需要正对着弹出它的元素
http://www.cocoachina.com/bbs/read.php?tid=22000
* popover应该随时可以通过点他范围之外的地方来dismiss掉,换句话说,不要用modal方式
* popover不要太大,宽度不要超过600;
* alertview也要用popover的方式出来
http://www.cntxk.com/CataNews/35/info666.html
Popover cool effect
Popover menu (not free)
http://www.binpress.com/app/popover-menu-for-ios/604
http://www.youtube.com/watch?feature=endscreen&v=8Kv68erU9uI&NR=1
Popover effect
http://www.youtube.com/watch?v=gxCukeT5rWg