从iOS 8开始,苹果提出新的 UIPopoverPresentationController代替UIPopoverController:

新的UIPopoverPresentationController使用方法如下:

    // 创建将要显示的Controller
DJCategoryViewController *categoryVC = [[DJCategoryViewController alloc] init];
// 设置控制器View的显示大小
categoryVC.preferredContentSize = CGSizeMake(, );
// 设置Modal类型
categoryVC.modalPresentationStyle = UIModalPresentationPopover;
// 获取Popover
UIPopoverPresentationController *categoryPopover = categoryVC.popoverPresentationController;
// 相对于哪个View来显示
categoryPopover.sourceView = self.categoryItem.customView;
// 显示位置
categoryPopover.sourceRect = self.categoryItem.customView.bounds;
// 设置popover箭头的显示方向
categoryPopover.permittedArrowDirections = UIPopoverArrowDirectionAny;
// 跳转
[self presentViewController:categoryVC animated:YES completion:nil];

iOS8新特性(1)-UIPopoverPresentationController使用的更多相关文章

  1. iOS8新特性(1)——UIAlertController

    一.iOS8介绍 iOS8 新特性,主要是UI上进行了统一 1.UIAlertController 2.UIPresentaionController:管理所有通过modal出来的控制器(看笔记) 3 ...

  2. iOS8 新特性

    iOS8新特性主要体现在4方面 1.UIAlertController 对alert&actionSheet的封装 UIAlertController.h 提示框按钮的选择 typedef N ...

  3. ios8新特性widget开发-b

    os8发布已经有一段时间了,伴随着ios8同时也出现了许多新的特性,ios系统将会越来越开放,这是好事.其中一个新特性就是在下拉通知栏里加入了个性的widget,开发者可以自己定义widget的样式内 ...

  4. iOS8新特性

    1. App Extension Programming Guide 2.LocalAuthentication.framework - Touch ID Authentication 3.Local ...

  5. iOS iOS8新特性--UIPopoverPresentationController

    1.回顾UIPopoverController的使用,下面这份代码只能在ipad下运行 // 初始化控制器,SecondViewController类继承自UIViewController Secon ...

  6. 利用iOS8新特性计算cell的实际高度

    在计算cell的实际高度是 我们一般是通过计算frame  拿到最底部一个控件的最大Y值从而的到cell 的高度  算来算去  比较麻烦 其实,iOS8已经提供了直接通过Cell高度自适应的方法了,根 ...

  7. iOS8新特性之基于地理位置的消息通知UILocalNotification

              苹果在WWDC2014上正式公布了全新的iOS8操作系统. 界面上iOS8与iOS7相比变化不大,只是在功能方面进行了完好.                             ...

  8. iOS8新特性之交互式通知

    目前分为四个推送:用户推送,本地推送,远程推送,地理位置推送. if (IS_IOS8) { //1.创建消息上面要添加的动作(按钮的形式显示出来) UIMutableUserNotification ...

  9. Ios8新特性-应用程序扩展

    一.什么是应用程序扩展? 应用程序扩展不是一个应用,它是主体应用程序(containing app)中一个单独的包,并能生成单独的二进制文件供其他应用调用. 个人感觉,类似于WP中的启动器,把系统当个 ...

随机推荐

  1. Oracle创建用户设置权限

    (转:http://www.cnblogs.com/yangy608/archive/2011/08/22/2148893.html) create user TEST identified by & ...

  2. MarkDown+LaTex 数学内容编辑样例收集

    $\color{green}{MarkDown+LaTex 数学内容编辑样例收集}$ 1.大小标题的居中,大小,颜色 [例1] $\color{Blue}{一元二次方程根的分布}$ $\color{R ...

  3. mac下搭建redis环境

    一.redis简介 redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合)和zset(有 ...

  4. U3D 打包时找不到tag的问题

    在公司改完一个功能,把工程拷回家打开后,编辑器模式下运行正常,打包PC平台和安卓平台时都报错,找不到chatContent这个tag,察看了下下拉列表中明明有这个tag,并且勾选上了,但是点击add ...

  5. [LeetCode] Guess Number Higher or Lower II 猜数字大小之二

    We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to gues ...

  6. [LeetCode] Russian Doll Envelopes 俄罗斯娃娃信封

    You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envel ...

  7. SQL基础语法(二)

    SQL SELECT 语句 本章讲解 SELECT 和 SELECT * 语句. SQL SELECT 语句 SELECT 语句用于从表中选取数据. 结果被存储在一个结果表中(称为结果集). SQL ...

  8. jdbc读取数据库,表相关信息(含注释)

    读取数据库中的所有的表名 private Set<String> getTableNameByCon(Connection con) { Set<String> set = n ...

  9. Apache service named reported the following error(OS 10055)由于系统缓冲区空间不足或队列已满解决办法?

    apache启动失败报错: The Apache service named reported the following error:>>> AH00451: no listeni ...

  10. Android 轮换控件

    首先是控件轮换 一.创建主布局 1.用到的控件是 TextSwitcher (文本轮换) 那么其他对应的也就是 ImageSwitcher (图片轮换) <LinearLayout xmlns: ...