iOS8新特性(1)-UIPopoverPresentationController使用
从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使用的更多相关文章
- iOS8新特性(1)——UIAlertController
一.iOS8介绍 iOS8 新特性,主要是UI上进行了统一 1.UIAlertController 2.UIPresentaionController:管理所有通过modal出来的控制器(看笔记) 3 ...
- iOS8 新特性
iOS8新特性主要体现在4方面 1.UIAlertController 对alert&actionSheet的封装 UIAlertController.h 提示框按钮的选择 typedef N ...
- ios8新特性widget开发-b
os8发布已经有一段时间了,伴随着ios8同时也出现了许多新的特性,ios系统将会越来越开放,这是好事.其中一个新特性就是在下拉通知栏里加入了个性的widget,开发者可以自己定义widget的样式内 ...
- iOS8新特性
1. App Extension Programming Guide 2.LocalAuthentication.framework - Touch ID Authentication 3.Local ...
- iOS iOS8新特性--UIPopoverPresentationController
1.回顾UIPopoverController的使用,下面这份代码只能在ipad下运行 // 初始化控制器,SecondViewController类继承自UIViewController Secon ...
- 利用iOS8新特性计算cell的实际高度
在计算cell的实际高度是 我们一般是通过计算frame 拿到最底部一个控件的最大Y值从而的到cell 的高度 算来算去 比较麻烦 其实,iOS8已经提供了直接通过Cell高度自适应的方法了,根 ...
- iOS8新特性之基于地理位置的消息通知UILocalNotification
苹果在WWDC2014上正式公布了全新的iOS8操作系统. 界面上iOS8与iOS7相比变化不大,只是在功能方面进行了完好. ...
- iOS8新特性之交互式通知
目前分为四个推送:用户推送,本地推送,远程推送,地理位置推送. if (IS_IOS8) { //1.创建消息上面要添加的动作(按钮的形式显示出来) UIMutableUserNotification ...
- Ios8新特性-应用程序扩展
一.什么是应用程序扩展? 应用程序扩展不是一个应用,它是主体应用程序(containing app)中一个单独的包,并能生成单独的二进制文件供其他应用调用. 个人感觉,类似于WP中的启动器,把系统当个 ...
随机推荐
- python排序之二冒泡排序法
python排序之二冒泡排序法 如果你理解之前的插入排序法那冒泡排序法就很容易理解,冒泡排序是两个两个以向后位移的方式比较大小在互换的过程好了不多了先上代码吧如下: 首先还是一个无序列表lis,老规矩 ...
- 【Linux管理】用户管理
每次玩linux都会去网上找一些命令,想想应该记录一下,希望方便大家,当然更方便自己. 1.添加用户 useradd username//添加用户 passwd username//设置密码 2.配置 ...
- USACO . Friday the Thirteenth
Friday the Thirteenth Is Friday the 13th really an unusual event? That is, does the 13th of the mont ...
- Intellij IDEA的一些东西
Intellij IDEA的一些东西 2016-03-19 15:26 Ctrl + R 在当前文件进行文本替换 (必备) Ctrl + N 根据输入的 类名 查找类文件 Ctrl + Ctrl + ...
- 基于pcDuino-V2的无线视频智能小车
这段时间抽空做了个智能视频小车.包含了pid电机控制.socket网络编程.多线程编程.epoll机制.gtk图形界面编程. 这是界面: 小车的底层是用的stm32f405系列的单片机+电机驱动做的一 ...
- 【第四篇】ASP.NET MVC快速入门之完整示例(MVC5+EF6)
目录 [第一篇]ASP.NET MVC快速入门之数据库操作(MVC5+EF6) [第二篇]ASP.NET MVC快速入门之数据注解(MVC5+EF6) [第三篇]ASP.NET MVC快速入门之安全策 ...
- [LeetCode] Island Perimeter 岛屿周长
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represen ...
- [LeetCode] Water and Jug Problem 水罐问题
You are given two jugs with capacities x and y litres. There is an infinite amount of water supply a ...
- [LeetCode] Word Break II 拆分词句之二
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each ...
- 【前端积累】SEO 学习
白帽SEO:网站标题 关键字 描述 网站内容优化 Robot.txt文件 网站地图 增加外链引用 网站结构布局优化:扁平化结构 控制首页链接数量:中小网站100以内,页面导航.底部 ...