让UIAlertController兼容的同时iphone和ipad

by 吴雪莹

var alert = UIAlertController(title: nil, message: message, preferredStyle: UIAlertControllerStyle.ActionSheet)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: { (alert:UIAlertAction!) -> Void in
println("You tapped OK")
}))
alert.popoverPresentationController? .sourceView = view
alert.popoverPresentationController?.sourceRect = sender.frame
self.presentViewController(alert, animated: true, completion: nil)

版权声明:本文博客原创文章。博客,未经同意,不得转载。

让UIAlertController兼容的同时iphone和ipad的更多相关文章

  1. daily news新闻阅读客户端应用源码(兼容iPhone和iPad)

    daily news新闻阅读客户端应用源码(兼容iPhone和iPad),也是一款兼容性较好的应用,可以支iphone和ipad的阅读阅读器源码,设计风格和排列效果很不错,现在做新闻资讯客户端的朋友可 ...

  2. iphone 与 ipad -- UIPopoverPresentationViewController

    iOS8.0之后, 苹果推出了UIPopoverPresentationViewController, 在弹出控制器时, 统一采用 presentViewController, 但是要实现iPhone ...

  3. Swift - 判断设备类型开发兼容的iOS应用(iPad使用分隔视图控制器)

    1,分割视图控制器(UISplitViewController) 在iPhone应用中,使用导航控制器由上一层界面进入下一层界面. 但iPad屏幕较大,通常使用SplitViewController来 ...

  4. 在Mac电脑上为iPhone或iPad录屏的方法

    在以前的Mac和iOS版本下,录制iPhone或者iPad屏幕操作是一件稍微复杂的事情.但是随着Yosemite的出现,在Mac电脑上为iPhone或iPad录屏的方法就变得简单了.下面就介绍一下具体 ...

  5. iPhone与iPad在开发上的区别

    *:first-child { margin-top: 0 !important; } body > *:last-child { margin-bottom: 0 !important; } ...

  6. iOS 为iPhone和iPad创建不同的storyboard

    复制Main.storyboard,重命名为Main_iPad.storyboard 在info.plist文件中添加 Main storyboard file base name (iPad) -- ...

  7. css去掉iPhone、iPad默认按钮样式

    原文链接:http://blog.sina.com.cn/s/blog_7d796c0d0102uyd2.html 只要在样式里面加一句去掉css去掉iPhone.iPad的默认按钮样式就可以了!~ ...

  8. CRM2013版本 IOS APP 说明(IPhone、IPad)

    CRM2013版本 IOS APP 说明(IPhone.IPad) IPhone版本 首页 CRM APP在登录时输入账号信息,可以进行首面.其首页显示内容可以在CRM后台设置. 系统默认显示:Pho ...

  9. Iphone和iPad适配, 横竖屏

    竖屏情况下: [UIScreen mainScreen].bounds.size.width = 320 [UIScreen mainScreen].bounds.size.width = 568 横 ...

随机推荐

  1. COJ 1102 - You Can Say 11 题解

    本题就是给出一个无穷大数,算其能否被11除尽 Description Your job is, given a positive number N, determine if it is a mult ...

  2. 使用DbUtils实现CRUD

    commons-dbutils 这是 Apache 提供了一个开源组织 JDBC工具库,它是JDBC简包,学习成本低,和使用dbutils可以大大简化jdbc的工作量,同一时候也不会影响程序的性能.因 ...

  3. VC档(夹)文件夹路径的经营方针和代码

    ***********************************************声明*************************************************** ...

  4. poj3928 Ping pong 树状数组

    http://poj.org/problem?id=3928 Ping pong Time Limit: 1000MS   Memory Limit: 65536K Total Submissions ...

  5. leetcode第一刷_Maximum Depth of Binary Tree

    这道题预计是ac率最高的一道了.你当然能够用层序遍历,我佩服你的耐心和勇气.由于看到别人的三行代码,会不会流眼泪呢.. class Solution { public: int maxDepth(Tr ...

  6. VS2010或2012中,如何设置代码格式化?

    ctrl + E,D菜单在 编辑-->高级 里面 第一个菜单项

  7. sqlserver 无法初始化via支持库[QLVIPL.DLL]

    安装数据库后,在sqlserver configuration manager, sqlserver的网络配置,有将协议 shared memory,named pipes,tcp/ip,via全部启 ...

  8. HTML5 3D翻书效果(双面效应)

    最后使用HTML5翻书效果达到测试,比较简单,它的升级版是 最后一个问题: 1)后,原来的页面连环画将成为一面镜子 2)无法实现双面翻书. 3)明显感觉页面似有近遮挡标志. 这次的升级版本号实现过程比 ...

  9. Team Foundation Server 2015使用教程--团队项目删除

  10. Windows PHone 8 获取硬件信息

    /// <summary> /// 获取系统信息 /// </summary> private string GetDeviceInfo() { StringBuilder s ...