如何在Swift 3.0中设置scrollview内容大小 [英] how to set scrollview content size in swift 3.0
本文介绍了如何在Swift 3.0中设置scrollview内容大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
更新后的Xcode8无法为ScrollView
设置contentSize
.我无法使用CGSizeMake
.
谁能帮我吗?
After updated Xcode8 not able to set contentSize
for ScrollView
. I can't able to use CGSizeMake
.
Can anyone help me?
我尝试过
scrollView.contentSize = CGSizeMake(self.view.frame.size.width, 700)
推荐答案
在Swift 3中CGSizeMake
不可用,请改用CGSize
init.
From Swift 3 CGSizeMake
is not available use CGSize
init instead.
scrollView.contentSize = CGSize(width: self.view.frame.size.width, height: 700)
从Swift 3开始,在核心图形上查看Apple文档,他们取得了很多成就变化.
Check the Apple Documentation on Core Graphics as of from Swift 3 they have made a lot of changes.
这篇关于如何在Swift 3.0中设置scrollview内容大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文