iOS-iPad开发之popoverController使用介绍

iOS开发UI篇—popoverController使用注意

iOS SDK:自定义Popover(弹出窗口)

实现的简单例子:

      //1.新建一个内容控制器
YYMenuViewController *menuVc=[[YYMenuViewController alloc]init]; //2.新建一个popoverController,并设置其内容控制器
self.popover=[[UIPopoverController alloc]initWithContentViewController:menuVc]; //3.设置尺寸
self.popover.popoverContentSize=CGSizeMake(300, 200); //4.显示
[self.popover presentPopoverFromBarButtonItem:self.navigationItem.leftBarButtonItem permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

显示popoverController的两种方式

(1)围绕着一个UIBarButtonItem显示(箭头指定那个UIBarButtonItem)

- (void)presentPopoverFromBarButtonItem:(UIBarButtonItem *)item permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated;

item :围绕着哪个UIBarButtonItem显示

arrowDirections :箭头的方向

animated :是否通过动画显示出来

(2)围绕着某一块特定区域显示(箭头指定那块特定区域)

- (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated;

rect :指定箭头所指区域的矩形框范围(位置和尺寸),以view的左上角为坐标原点

view :rect参数是以view的左上角为坐标原点(0,0)

arrowDirections :箭头的方向

animated :是否通过动画显示出来

iOS-iPad开发之popoverController使用介绍的更多相关文章

  1. iOS iPad开发之UIPopoverController的使用

    1. 什么是UIPopoverController? 是iPad开发中常见的一种控制器(在iphone上不允许使用) 跟其他控制器不一样的是,它直接继承自NSObject,并非继承自UIViewCon ...

  2. iOS开发UI篇—popoverController简单介绍

    iOS开发UI篇—popoverController简单介绍 一.简单介绍 1.什么是UIPopoverController 是iPad开发中常见的一种控制器(在iPhone上不允许使用) 跟其他控制 ...

  3. iOS-iPad开发之SplitViewController简单介绍

    iOS-iPad开发之SplitViewController简单介绍 SplitViewController图形化创建 SplitViewController可以并列显示两个view,适用于基于nav ...

  4. iOS多线程开发之GCD(中篇)

    前文回顾: 上篇博客讲到GCD的实现是由队列和任务两部分组成,其中获取队列的方式有两种,第一种是通过GCD的API的dispatch_queue_create函数生成Dispatch Queue:第二 ...

  5. iOS多线程开发之NSOperation - 快上车,没时间解释了!

    一.什么是NSOperation? NSOperation是苹果提供的一套多线程解决方案.实际上NSOperation是基于GCD更高一层的封装,但是比GCD更加的面向对象.代码可读性更高.可控性更强 ...

  6. iOS游戏开发之UIDynamic

    iOS游戏开发之UIDynamic 简介 什么是UIDynamic UIDynamic是从iOS 7开始引入的一种新技术,隶属于UIKit框架 可以认为是一种物理引擎,能模拟和仿真现实生活中的物理现象 ...

  7. iOS多线程开发之NSOperation

    一.什么是NSOperation? NSOperation是苹果提供的一套多线程解决方案.实际上NSOperation是基于GCD更高一层的封装,但是比GCD更加的面向对象.代码可读性更高.可控性更强 ...

  8. iOS多线程开发之GCD(死锁篇)

    上篇和中篇讲解了什么是GCD,如何使用GCD,这篇文章将讲解使用GCD中将遇到的死锁问题.有兴趣的朋友可以回顾<iOS多线程开发之GCD(上篇)>和<iOS多线程开发之GCD(中篇) ...

  9. iOS多线程开发之GCD(中级篇)

    前文回顾: 上篇博客讲到GCD的实现是由队列和任务两部分组成,其中获取队列的方式有两种,第一种是通过GCD的API的dispatch_queue_create函数生成Dispatch Queue:第二 ...

随机推荐

  1. CENTOS elasticsearch plugin install:Failed: SSLException[java.security.ProviderException,解决

    安装Elasticsearch插件时总报SSLException yum upgrade nss 解决

  2. Find your present (2) (位异或)

    Problem Description In the new year party, everybody will get a "special present".Now it's ...

  3. iOS网络

    iOS开发系列--网络开发 2014-10-22 08:34 by KenshinCui, 1253 阅读, 19 评论, 收藏,  编辑 概览 大部分应用程序都或多或少会牵扯到网络开发,例如说新浪微 ...

  4. http server v0.1_http_reponse.c

    #include <string.h> #include <sys/stat.h> #include <sys/mman.h> #include <fcntl ...

  5. Android开源项目发现---Spinner选择器与日历选择器篇(持续更新)

    1. android-times-square Android日历部件 支持选取单个日期,多个日期,及日期区间段和对话框形式显示 项目地址:https://github.com/square/andr ...

  6. leetcode面试准备: Jump Game II

    1 题目 Given an array of non-negative integers, you are initially positioned at the first index of the ...

  7. 【HDOJ】1892 See you~

    wa了十次,原来变量名写错.二维树状数组. #include <cstdio> #include <cstring> #define MAXN 1002 int nums[MA ...

  8. vector,list,deque容器的迭代器简单介绍

    我们知道标准库中的容器有vector,list和deque.另外还有slist,只不过它不是标准容器.而谈到容器,我们不得不知道进行容器一切操作的利器---迭代器.而在了解迭代器之前,我们得先知道每个 ...

  9. page.Response.WriteFile(newpath);

    page.Response.Clear();            page.Response.ClearHeaders();            page.Response.Buffer = fa ...

  10. 【转】Android编译系统详解(三)——编译流程详解

    原文网址:http://www.cloudchou.com/android/post-276.html 本文原创作者:Cloud Chou. 欢迎转载,请注明出处和本文链接 1.概述 编译Androi ...