今天开发在Storyboard页面中使用ScrollView,在 viewWillAppear 和 viewDidLoad 中设置了contentSize无效
解决办法:在viewDidAppear设置contentSize
override func viewDidAppear(_ animated: Bool) {
scrollView.contentSize = CGSize.init(width: UIScreen.main.bounds.width, height: 800);
scrollView.isScrollEnabled=true;
scrollView.showsVerticalScrollIndicator = false;
}