本文转载至  http://blog.csdn.net/liuwuguigui/article/details/39494435

1.iPad上使用presentModalViewController,custion size not work on ios8 SDK。使用如下方法解决:

In iOS 8 you can also use UIPresentationController which gives you more customization options.

#define IsiOS8Later ([[[UIDevice currentDevice] systemVersion] doubleValue]>=8.0)?YES:NO

This will Work:

AboutViewController * _aboutViewController = [[AboutViewController alloc] init];
_aboutViewController.modalPresentationStyle = UIModalPresentationFormSheet;
if(IS_IOS8)
{
_aboutViewController.preferredContentSize = CGSizeMake(300, 300);
}
[self presentViewController:_aboutViewController animated:YES completion:nil];

In AboutViewController.m

- (void)viewWillLayoutSubviews{
[super viewWillLayoutSubviews]; if(!IS_IOS8)
{
self.view.superview.bounds = CGRectMake(0, 0, 300, 300);
}
}

 

最新文章

  1. Redis C#缓存的使用
  2. 【C】制作简单的时钟减法程序
  3. Sigmaplot激活码获取地址
  4. 初始化httpclient的几种方式
  5. java生成验证码的逻辑
  6. java 构造函数内部的多态方法 完全剖析
  7. 单选复选按钮以及Toast学习笔记
  8. Editplus 中将文本换行替换为<p>标签的正则表达式
  9. Kicad中批量添加过孔
  10. HDU 3572 最大流
  11. 浅析 C++里面的宏
  12. Struts2实现国际化
  13. Jquery取属性值(复选框、下拉列表、单选按钮)、做全选按钮、JSON存储、去空格
  14. CodeSmith系列(三)——使用CodeSmith生成ASP.NET页面
  15. hadoop问题: bin/hadoop fs -ls ls: `.': No such file or directory
  16. [Reinforcement Learning] Model-Free Prediction
  17. Vue一个案例引发「动画」的使用总结
  18. 2018-06-20 中文代码示例视频演示Python入门教程第四章 控制流
  19. 红米Note5进入全网通5.0时代,其实是高通已经落后了!
  20. java反射机制实例

热门文章

  1. hdu 6021 MG loves string
  2. Change visual studio 2015 enterprise installation path(转)
  3. 我的js为什么会触发两次
  4. redis常用命令与使用分析
  5. Spring Cloud服务的注册与发现
  6. TF-IDF学习笔记
  7. javascript 对象初探 (六)--- call()和apply()初探
  8. Android CrashHandler
  9. DICOM医学图像处理:Deconstructed PACS之Orthanc
  10. git/icode操作记录