iOS: popover

125 篇文章 1 订阅

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.

This property contains the desired size for the view controller when it is displayed in a popover. By default, the width is set to 320 points and the height is set to 1100 points. You can change these values as needed.

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



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值