how to set scrollview content size in swift 3.0 [duplicate]

风格不统一 提交于 2019-12-01 14:38:21

问题


After updated Xcode8 not able to set contentSize for ScrollView. I can't able to use CGSizeMake. Can anyone help me?

I have tried

scrollView.contentSize = CGSizeMake(self.view.frame.size.width, 700)

回答1:


From Swift 3 CGSizeMake is not available use CGSize init instead.

scrollView.contentSize = CGSize(width: self.view.frame.size.width, height: 700)

Check the Apple Documentation on Core Graphics as of from Swift 3 they have made a lot of changes.



来源:https://stackoverflow.com/questions/39772422/how-to-set-scrollview-content-size-in-swift-3-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!