从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. Yii2 modal中 ajax提交表单

    view: // view 代码 $form = ActiveForm::begin(['id' => $model->formName()]); // js 代码 $js = <& ...

  2. PHP语法(二):数据类型、运算符和函数

    相关链接: PHP语法(一):基础和变量 PHP语法(二):数据类型.运算符和函数 PHP语法(三):控制结构(For循环/If/Switch/While) 这次整理了PHP的数据类型.运算符和函数. ...

  3. Spring MVC之@RequestParam @RequestBody @RequestHeader 等详解

    (转自:http://blog.csdn.net/walkerjong/article/details/7946109#) 引言: 接上一篇文章,对@RequestMapping进行地址映射讲解之后, ...

  4. 对C#泛型实例化对像

    public class A { } public class B<T> { public static T Get() { //在这一块如何实例化T这个对象呢?如果用default(T) ...

  5. IT技术思维导图

    在网上看到有个人总结的java技术的东东,觉得很好,就保存下来了,码农还真是累啊,只有不断的学习才能有所提高,才能拿更多的RMB啊. java技术思维导图 服务端思维导图 前端思维导图

  6. 深入java集合学习2-ArrayList的实现原理

    ArrayList概述 类概述 ArrayList是List 接口的大小可变数组的实现.实现了所有可选列表操作,并允许包括 null 在内的所有元素. 每个 ArrayList 实例都有一个容量(ca ...

  7. Java的JDBC操作

    Java的JDBC操作 [TOC] 1.JDBC入门 1.1.什么是JDBC JDBC从物理结构上来说就是java语言访问数据库的一套接口集合,本质上是java语言根数据库之间的协议.JDBC提供一组 ...

  8. [LeetCode] Repeated Substring Pattern 重复子字符串模式

    Given a non-empty string check if it can be constructed by taking a substring of it and appending mu ...

  9. [LeetCode] Valid Palindrome 验证回文字符串

    Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignori ...

  10. python获取父类的子类(遍历,递归),并循环执行所有子类的某一方法

    前言 换了新工作,踏足于python语言的开发,也把自己的学习过程记录下来. 一,递归获取某一父类的所有子类 all_subclasses = {'0': '0'} def get_all_class ...