Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> iOS

วิธีปิด Scroll View ด้วยโปรแกรมใน iOS

Scroll View เป็นหัวข้อที่ซับซ้อน บทความนี้สอนปิด Scroll View ด้วยโปรแกรม

ตั้งค่า property isScrollEnabled ของ Scroll View เป็น false

import UIKit
class ViewController: UIViewController {
@IBOutlet var scrollView: UIScrollView!
override func viewDidLoad() {
super.viewDidLoad()
scrollView.isScrollEnabled = false
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}