presentModalViewController使用 UIModalPresentationFormSheet,无法改变frame大小
来源:互联网 发布:淘宝被扣12分能恢复吗 编辑:程序博客网 时间:2024/04/28 09:39
TestViewController *testVC = [[TestViewController alloc] initWithNibName:@"TestViewController" bundle:nil];
testVC.modalPresentati*****tyle = UIModalPresentationFormSheet;
testVC.modalTransiti*****tyle = UIModalTransiti*****tyleCrossDissolve;
[self presentModalViewController:testVC animated:YES];
testVC.view.superview.frame = CGRectMake(0, 0, 649, 397);//it's important to do this after presentModalViewController
testVC.view.superview.center = self.view.center;
testVC.modalPresentati*****tyle = UIModalPresentationFormSheet;
testVC.modalTransiti*****tyle = UIModalTransiti*****tyleCrossDissolve;
[self presentModalViewController:testVC animated:YES];
testVC.view.superview.frame = CGRectMake(0, 0, 649, 397);//it's important to do this after presentModalViewController
testVC.view.superview.center = self.view.center;
注意:/it's important to do this after presentModalViewController
可以按以上方法实现。
用另外一种方式,你用的这种是针对整个controller的,你可以用[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
// forView:theView cache:YES];
iOS8 不能设置frame
UIViewController* modalController = [[UIViewController alloc]init];modalController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;modalController.modalPresentationStyle = UIModalPresentationFormSheet;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;// Resizing for iOS 8modalController.preferredContentSize = CGSizeMake(frameSize.x, frameSize.y); // Resizing for <= iOS 7modalController.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];
0 0
- presentModalViewController使用 UIModalPresentationFormSheet,无法改变frame大小
- presentModalViewController使用 UIModalPresentationFormSheet,无法改变frame大小
- UIViewController的frame改变大小
- UIModalPresentationFormSheet 改变加变大小
- 让EditPart无法改变大小
- UIModalPresentationFormSheet模式下resignFirstResponder无法隐藏键盘
- iOS 设置presentModalViewController的大小
- javascript 动态改变框架frame,iframe的大小
- 如何让frame的大小固定,不能被用户改变?
- UIView在设置superview frame的时候会改变大小
- transitionFromViewController 改变VC.view.frame 大小不起作用的问题
- 改变frame
- 使用 presentModalViewController 异常
- 正确使用PresentModalViewController
- 正确使用PresentModalViewController
- presentModalViewController的使用
- IOS: 正确使用PresentModalViewController
- IOS: 正确使用PresentModalViewController
- 使用UDP编写一个四选一数据选择器
- IPv6 network stack bigpicture
- JSP 截取字符串 { EL表达式截取字符串}
- CSS中怎么让DIV居中
- 字符串验证工具类
- presentModalViewController使用 UIModalPresentationFormSheet,无法改变frame大小
- 在TabControl中的TabPage选项卡中添加Form窗体
- angular中的异步编程 $q的使用
- 5.打印数组中对象中文 修改状态栏 加载plist 动画代理式
- postgreSQL常用命令
- android 电池(一):锂电池基本原理篇
- android CursorLoader用法介绍
- 网易电面实习生(成功拿到offer)
- Numpy随记