你真的能在游乐场的UIScrollView中滚动吗?在下面的示例中,我希望能够向下滚动并看到标签。
import UIKit
import XCPlayground
let contentView = UIView(frame: CGRectMake(0, 0, 200, 200))
contentView.backgroundColor = UIColor.yellowColor()
let label = UILabel(frame: CGRectMake(0, 120, 20, 20))
label.text = "a"
contentView.addSubview(label)
let scrollView = UIScrollView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
scrollView.contentSize = CGSize(width: 200, height: 200)
scrollView.addSubview(contentView)
scrollView.flashScrollIndicators()
XCPlaygroundPage.currentPage.liveView = scrollViewhttps://stackoverflow.com/questions/35935713
复制相似问题