zoukankan      html  css  js  c++  java
  • 分享功能使用的UIPopoverController在iOS9 过期,替换为popoverPresentationController

    复制代码

    记录一下 以备以后用到的时候拿出来看看。
    以前使用的:
    复制代码
    1 if (UIDevice.currentDevice().userInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
    2  presentViewController(vc, animated: true, completion: nil)
    3 } else if (popover == nil || !popover!.popoverVisible) {
    4                 popover = UIPopoverController(contentViewController: vc)
    5              popover!.delegate = self                         popover?.presentPopoverFromRect(inviteView.frame, inView: self.view, permittedArrowDirections: UIPopoverArrowDirection.Any, animated: true) 
    复制代码

    现在使用:
    if #available(iOS 8.0, *) { vc.modalPresentationStyle = UIModalPresentationStyle.Popover vc.popoverPresentationController?.sourceView = inviteView vc.popoverPresentationController?.sourceRect = inviteView.bounds vc.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.Any presentViewController(vc, animated: true, completion: nil) } else { //DeviceUtils.isIOS7() if (UIDevice.currentDevice().userInterfaceIdiom == UIUserInterfaceIdiom.Phone) { presentViewController(vc, animated: true, completion: nil) } else if (popover == nil || !popover!.popoverVisible) { popover = UIPopoverController(contentViewController: vc) popover!.delegate = self popover?.presentPopoverFromRect(inviteView.frame, inView: self.view, permittedArrowDirections: UIPopoverArrowDirection.Any, animated: true) } // Fallback on earlier versions }
    复制代码

     

  • 相关阅读:
    《JAVA多线程编程核心技术》 笔记:第四章、Lock的使用
    服务器负载粗略估算
    spring事务传播性理解
    BlockingQueue 阻塞队列2
    六大原则
    mycat之schema.xml理解
    mycat分库读写分离原理
    sqlservere连接问题
    java代码添加mysql存储过程,触发器
    Amoeba+Mysql实现读写分离+java连接amoeba
  • 原文地址:https://www.cnblogs.com/fengmin/p/5708350.html
Copyright © 2011-2022 走看看