• iOS8新特性(1)-UIPopoverPresentationController使用


    从iOS 8开始,苹果提出新的 UIPopoverPresentationController代替UIPopoverController:

    新的UIPopoverPresentationController使用方法如下:

        // 创建将要显示的Controller
        DJCategoryViewController *categoryVC = [[DJCategoryViewController alloc] init];
        // 设置控制器View的显示大小
        categoryVC.preferredContentSize = CGSizeMake(300, 360);
        // 设置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];
  • 相关阅读:
    Java设计模式:单例模式
    Java设计模式:工厂方法模式
    Ubuntu16.04上搭建CDH5.14集群
    Spark 消息通信架构
    spark性能优化之shuffle优化
    spark的性能优化
    Hbase 的 Compaction
    Hbase要掌握的内容
    yarn的架构及原理
    MapReduce工作原理
  • 原文地址:https://www.cnblogs.com/yongdaimi/p/6250337.html
Copyright © 2020-2023  润新知