iOS- iPad UIPopoverController
在IPAD开发中,有一个很有趣的视图控制器,UIPopoverControllr,它的初始化必须要设置一个"内容视图",相当于它本身只是作为一个“容器”,而显示的内容还需要另外一个视图。
初始化:
-(void)show:(UIButton *)button{
// TableViewController *tb=[[TableViewController alloc]initWithNibName:nil bundle:nil];
TableViewController *popoverViewController = [[TableViewController alloc]initWithNibName:nil bundle:nil];
popoverViewController.title = @"选择你喜欢的颜色";
UINavigationController *nav = [[UINavigationController alloc]
initWithRootViewController:popoverViewController];
self.poc = [[UIPopoverController alloc] initWithContentViewController:nav];
[self.poc presentPopoverFromRect:button.bounds inView:button permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}
//如果不需要圆角,可以在内容控制器中加入:
- (void)viewWillAppear:(BOOL)animated
{
self.view.superview.layer.cornerRadius= ;
}
UIPopoverController 设定大小:
self.popover.popoverContentSize = CGSizeMake(, ); UIPopoverPresentationController设定大小:
UIPopoverPresentationController *presentationController = [vc popoverPresentationController]; vc.preferredContentSize = CGSizeMake(, ); sourceRect sourceView这里俩属性 是所在页面 popover箭头指向sourceRect中心 permittedArrowDirections设置为0即可以不显示箭头 如果想去掉圆角,在弹出控制器添加: - (void)viewWillAppear:(BOOL)animated {
self.view.superview.layer.cornerRadius
= ; }
iOS- iPad UIPopoverController的更多相关文章
- iOS:iPad和iPhone开发的异同(UIPopoverController、UISplitViewController)
iPad和iPhone开发的异同 1.iPhone和iPad: niPhone是手机,iPad.iPad Mini是平板电脑 iPhone和iPad开发的区别 屏幕的尺寸 \分辨率 UI元素的排布 \ ...
- iOS iPad开发之UIPopoverController的使用
1. 什么是UIPopoverController? 是iPad开发中常见的一种控制器(在iphone上不允许使用) 跟其他控制器不一样的是,它直接继承自NSObject,并非继承自UIViewCon ...
- ios之UIPopoverController
UIPopoverController是iPad上的iOS开发会常用到的一个组件(在iPhone设备上不允许使用),这个组件上手很简单,因为他的显示方法很少,而且参数简单,但我在使用过程中还常碰到各种 ...
- iPad UIPopoverController弹出窗口的位置和坐标
本文转载至:http://blog.csdn.net/chang6520/article/details/7921181 TodoViewController *contentViewControll ...
- [ios]ipad下的splitViewController 让你的APP看起来酷酷的!
在ipad下可以使用splitViewController splitViewController下包含两个viewController 这是一种将屏幕一分为二的方式. 在水平状态下会出现成两个左右两 ...
- Ios(ipad iphone) 支持字体一览
Font Name : ThonburiFont Name : Snell RoundhandFont Name : Academy Engraved LETFont Name : AvenirFon ...
- iOS ipad archives 时候 不显示icon
设置一下 plist文件
- 毫无保留开源我写的:IOS Android Ipad 多点触摸通用js 库
毫无保留开源我写的:IOS Android Ipad 多点触摸通用js 库 在线演示地址: http://m.yunxunmi.com/ 支持 IOS Android Ipad 等不同操作系统的手持或 ...
- iPad开发(相对于iPhone开发时专有的API)
iPad开发 一.iPad开发简介 1.什么是iPad 一款苹果公司于2010年发布的平板电脑 定价介于苹果的智能手机iPhone和笔记本电脑产品之间 跟iPhone一样,搭载的是iOS操作系统 2. ...
- JS判断客户端系统 让ipad iphone 等手持设备自动跳到手机版
if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i))) { location.replace("http:// ...
随机推荐
- BZOJ3175: [Tjoi2013]攻击装置
题解: 最大点独立集...好像水过头了... 不过发现我二分图好像忘完了!!! 代码: #include<cstdio> #include<cstdlib> #include& ...
- amoeba-mysql配置安装(收集整理)
本文收集整理自: Amoeba搞定mysql主从读写分离 http://blog.chinaunix.net/uid-20639775-id-154600.html Amoeba非常好用的mysql集 ...
- GRIB格式转换心得(转自博客:http://windforestwing.blog.163.com/blog/static/19545412007103084743804/)
1.wgrib的使用 在cmd命令行下键入wgrib后即可察看wgrib相关命令参数,简要介绍如下: l Inventory/diagnostic–output selections 详 ...
- 如何卸载eclipse中的ADT
卸载ADT的方法,方法如下: 1.选择 Help > Install New Software: 2.在"Details" 面板中, 点击"What is alre ...
- SharePoint 2010 出错! HTTP Error 503. The service is unavailable
转:http://544729.blog.51cto.com/534729/464087 昨天,公司的sharepoint 2010 无法打开,提示HTTP Error 503. The servic ...
- 非均匀B样条拟合MATLAB程序
直接上代码,多的不再说了. %------------------非均匀B样条拟合MATLAB程序----------------- clear k=; x=load('data.txt'); [n, ...
- ArcGIS 读写lyr层文件
原文arcengine C# 读写lyr(转) 写lyr IFeatureLayer LineLayer = axMapControl1.get_Layer() as IFeatureLayer; I ...
- 使用 Apache MINA2 实现 Web 系统的消息中间件
本文将介绍如何使用 Apache MINA2(以下简称 MINA2)解决复杂 Web 系统内各子系统之间同步消息中间件的问题.MINA2 为开发高性能和高可用性的网络应用程序提供了非常便利的框架.从本 ...
- 转换时间为 “XX分钟之前”
public static string getTimeAgo(string strDate) { string strTime = string.Empty; if (clsCommon.IsDat ...
- UVA 10462 Is There A Second Way Left? 次小生成树
模板题 #include <iostream> #include <algorithm> #include <cstdio> #include <cstdli ...