本文介紹了如何在 swift 3.0 中設置滾動視圖內容大小的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
更新后的 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 開始,查看關于 Core Graphics 的 Apple 文檔,他們已經做了很多變化.
Check the Apple Documentation on Core Graphics as of from Swift 3 they have made a lot of changes.
這篇關于如何在 swift 3.0 中設置滾動視圖內容大小的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!