iOS: popover

來源:互聯網
上載者:User

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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.