LazyBlog

1
2
3
4
5
-(void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews];
CGFloat padding = 0;
你的view.frame = CGRectMake(padding, padding, self.view.frame.size.width - padding * 2, self.view.frame.size.height - padding * 2);
}
1
2
3
4
5
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
var padding: CGFloat = 0
你的view.frame = CGRect(x: padding, y: padding, width: CGFloat(self.view.frame.size.width - padding * 2), height: CGFloat(self.view.frame.size.height - padding * 2))
}

 評論