我是attempting to change the size of a UIView
,我已將其放置在Storyboard中。由於某些原因,size does not change
但仍與故事板上繪製的相同。我沒有迷上Autolayout,所以這不能成爲它保持不變的原因。我的代碼:通過編程方式更改Storyboard上的UIView的大小
@IBOutlet weak var courseView: CourseView! // CourseView is a UIView
override func viewWillAppear(animated: Bool) {
courseView.frame = CGRectMake(0, 0, 200, 200) // This is just to test!
}
我也在viewDidLoad()
做過同樣的事情,但沒有成功。有任何想法嗎?
您正在使用'auto layout'嗎?在superview我的意思是 –