当前位置: 首页 > news >正文

关于ios 8 7 下的模态窗口大小的控制 代碼+場景(mainstoryboard)( Resizing UIModalPresentationFormSheet )...

1 代碼

UIViewController* modalController = [[UIViewController alloc]init];
modalController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
modalController.modalPresentationStyle = UIModalPresentationFormSheet;

//Resizing size
CGPoint frameSize = CGPointMake([[UIScreen mainScreen] bounds].size.width*0.95f, [[UIScreen mainScreen] bounds].size.height*0.95f);
CGRect screenRect = [[UIScreen mainScreen] bounds];
CGFloat screenWidth = screenRect.size.width;
CGFloat screenHeight = screenRect.size.height;
if ([[[UIDevice currentDevice]systemVersion] floatValue] >= 8.0 )
{
// Resizing for iOS 8
modalController.preferredContentSize = CGSizeMake(frameSize.x, frameSize.y);
}
else
{
// Resizing for <= iOS 7
modalController.view.superview.frame = CGRectMake((screenWidth - frameSize.x)/2, (screenHeight - frameSize.y)/2, frameSize.x, frameSize.y);
}
UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
[vc presentViewController:modalController animated:YES completion:nil];

 

2 場景

 打開態窗體屬性導航器Show Utilities=》找到show the attributes inspector=》修改Presentation +Content size大小(選中user preferred explicit size

 文件瀏覽器快捷鍵 cmd+0    工具欄(utilities)cmd+alt+0

转载于:https://www.cnblogs.com/Rampage/p/4061972.html

相关文章:

  • Metasploit运行环境内存不要低于2GB
  • mysql5.5升级5.6
  • html网站网址一键打包成App平台-开心App平台
  • 高斯模糊的简单算法
  • 扫盲!直播app源码搭建直播平台为什么要用到ShareSDK
  • php,perl计算crc
  • 用 Redis 轻松实现秒杀系统的构思
  • UITableView/UIScrollView 不能响应TouchBegin 的处理 及窥见 hitTest:withEvent:
  • UDP,TCP之间的区别
  • springboot 系列教程六:springboot mybatis集成
  • windows添加开机启动项
  • 关于Docker文件系统
  • XP和Win 7双系统安装说明和注意事项
  • jQuery之getAll()和cleanData()
  • 利用pig分析cdn访问日志内指定时间段的url访问次数
  • [nginx文档翻译系列] 控制nginx
  • 07.Android之多媒体问题
  • Hibernate最全面试题
  • JavaScript创建对象的四种方式
  • Javascript基础之Array数组API
  • js操作时间(持续更新)
  • JS创建对象模式及其对象原型链探究(一):Object模式
  • KMP算法及优化
  • leetcode378. Kth Smallest Element in a Sorted Matrix
  • leetcode46 Permutation 排列组合
  • Linux学习笔记6-使用fdisk进行磁盘管理
  • Redis在Web项目中的应用与实践
  • Shadow DOM 内部构造及如何构建独立组件
  • Vim Clutch | 面向脚踏板编程……
  • Vue UI框架库开发介绍
  • Yii源码解读-服务定位器(Service Locator)
  • 从零开始学习部署
  • 第2章 网络文档
  • 复杂数据处理
  • 搞机器学习要哪些技能
  • 关于使用markdown的方法(引自CSDN教程)
  • 关于字符编码你应该知道的事情
  • 和 || 运算
  • 开年巨制!千人千面回放技术让你“看到”Flutter用户侧问题
  • 小程序滚动组件,左边导航栏与右边内容联动效果实现
  • 一个普通的 5 年iOS开发者的自我总结,以及5年开发经历和感想!
  • 用element的upload组件实现多图片上传和压缩
  • ionic异常记录
  • scrapy中间件源码分析及常用中间件大全
  • 国内唯一,阿里云入选全球区块链云服务报告,领先AWS、Google ...
  • #《AI中文版》V3 第 1 章 概述
  • #pragma data_seg 共享数据区(转)
  • (9)STL算法之逆转旋转
  • (LeetCode C++)盛最多水的容器
  • (Mirage系列之二)VMware Horizon Mirage的经典用户用例及真实案例分析
  • (三)uboot源码分析
  • (详细版)Vary: Scaling up the Vision Vocabulary for Large Vision-Language Models
  • (转)shell调试方法
  • .bashrc在哪里,alias妙用
  • .bat批处理出现中文乱码的情况