Tom*_*yer 1 ios presentviewcontroller swift
我有一个视图,我想显示一个自定义大小的UIViewController.但我没有成功.这是我的代码.
var vx = KeyboardViewController()
vx.modalPresentationStyle = UIModalPresentationStyle.FormSheet
vx.preferredContentSize = CGSizeMake(self.view.frame.width, 150)
self.presentViewController(vx, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)
此UIViewController以全屏大小显示
您需要为呈现的视图控制器提供一个自定义transitioningDelegate,然后可以将自定义UIPresentationController插入到演示过程中,frameOfPresentedViewInContainerView您将对其进行适当的重写.
| 归档时间: |
|
| 查看次数: |
3160 次 |
| 最近记录: |