如何在swift中编写下面的代码。请帮忙。
UIView* destView = ((UIViewController *)segue.destinationViewController).view;
destView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
destView.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
谢谢!
答案 0 :(得分:1)
签出代码(Swift 3.1):
var destView: UIView? = (segue.destination as? UIViewController)?.view
destView?.autoresizingMask = [.flexibleWidth, .flexibleHeight]
destView?.frame = CGRect(x: CGFloat(0), y: CGFloat(0), width: CGFloat(view.frame.size.width), height: CGFloat(view.frame.size.height))