presentation Controllers的使用

presentation Controllers的使用

by 伍雪颖

@interface ViewController ()<UIPopoverPresentationControllerDelegate, UIAdaptivePresentationControllerDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
}

- (IBAction)show:(id)sender {
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    TestViewController *contentViewController = [storyboard instantiateViewControllerWithIdentifier:NSStringFromClass([TestViewController class])];
    contentViewController.modalPresentationStyle = UIModalPresentationPopover;
    UIPopoverPresentationController *detailPopover = contentViewController.popoverPresentationController;
    detailPopover.delegate = self;
    detailPopover.barButtonItem = sender;
    detailPopover.permittedArrowDirections = UIPopoverArrowDirectionAny;
    [self presentViewController:contentViewController animated:YES completion:nil];
}

- (UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller {
    return UIModalPresentationNone;
}

- (UIViewController *)presentationController:(UIPresentationController *)controller viewControllerForAdaptivePresentationStyle:(UIModalPresentationStyle)style {
    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller.presentedViewController];
    return navController;
}
时间: 2024-10-14 06:33:28

presentation Controllers的使用的相关文章

presentation Controllers的使用(二)

presentation Controllers的使用(二) by 伍雪颖 model过去: - (IBAction)show:(id)sender { SecondViewController *overlay = [[SecondViewController alloc] initWithCountry]; [self presentViewController:overlay animated:YES completion:nil]; } secondViewController.m -

A Look Inside Presentation Controllers

A Look Inside Presentation Controllers Session 228WWDC 2014 iOS 8 brings you powerful new means of presenting content within your apps. Hear how presentation controllers were leveraged by UIKit to give you fine grain control using new alert and searc

Displaying Your Views at Runtime

UIKit automatically loads views from your storyboard file when they are needed. As part of the loading process, UIKit performs the following sequence of tasks: Instantiates views using the information in your storyboard file. Connects all outlets and

WWDC 2014 Session笔记 - iOS界面开发的大一统

本文是我的 WWDC 2014 笔记 中的一篇,涉及的 Session 有 What's New in Cocoa Touch Building Adaptive Apps with UIKit What's New in Interface Builder View Controller Advancements in iOS 8 A Look Inside Presentation Controllers iOS 8 和 OS X 10.10 中一个被强调了多次的主题就是大一统,Apple

UIWindow in iOS

这篇文章,我将分享对UIWindow我所知道的东西. keyWindow 一个应用能够有许多UIWindow,“The key window”是其中一个,被设计用来接受键盘和其他与点击无关的事件.一个时间段中,如果只有一个Window,那么他就可能是keyWindow. 调用makeKeyAndVisible或者makeKeyWindow,能够使一个UIWindow变成keyWindow.注意,默认情况下,UIWindow是隐藏的.所以调用makeKeyAndVisible,即使一个UIWind

Controllers, Actions 和 Action Results

Controllers, Actions 和 Action Results 原文:Controllers, Actions, and Action Results作者:Steve Smith翻译:姚阿勇(Dr.Yao)校对:许登洋(Seay) Action 和 action result 是开发者使用 ASP.NET MVC 构建应用程序的基础部分. 什么是 Controller 在 ASP.NET MVC 中, 控制器( Controller )用于定义和聚合操作(Action)的一个集合.操

ngLazyLoad——让ng项目实现controllers按需异步加载

最初的源码来自:https://github.com/atian25/angular-lazyload/ 但由于一些个人的原因(我有强迫症...)所以把代码的书写风格按照我平日的喜好修改了下 也顺便认真的阅读了一遍源码,按照自己的理解,把原来的英文注释替换成中文的了 毕竟不是原作者,对ng框架也不是特别的熟,注释中的用词可能有不少不正确的地方,欢迎指出 下面是我稍微修改了一下的代码: /* * angular-lazyLoad * 一个angular项目的按需异步加载服务模块 * 支持 [Sea

SharePoint 创建列表并使用Windows Presentation Foundation应用程序管理列表

SharePoint创建列表并使用程序管理列表 列表是SharePoint开发人员输入数据的方式之一.使用Web界面创建一个列表并添加一些数据,步骤如下: 1. 打开站点. 2. 点击所有网站内容. 3. 点击创建. 4. 选择自定义列表,命名Customers,并输入描述.选中在快速启动导航显示,点击创建. 这将创建一个自定义列表.接下来我们添加三个栏:Region/Size/Sales. 1. 点击功能区创建栏按钮,命名Region,选择"选项"类型.增加四个选项:East/Wes

while an existing transition or presentation is occurring; the navigation stack will not be updated

使用UIAlertController提示信息,在之后使用navigation进行逻辑跳转时,出现popToViewController:transition: called on <UINavigationController 0x7fc27b8ac000> while an existing transition or presentation is occurring; the navigation stack will not be updated.错误.如图: 原因:dismiss操