在 iOS 中以程式設計方式停用滾動檢視?
滾動檢視是 iOS 開發人員遇到的最困難和最複雜的話題之一。這裡我們將瞭解如何以程式設計方式停用滾動檢視。
要進行停用,我們需要使我們滾動檢視的“isScrollEnabled”屬性變為 false。
在你的檔案中複製以下程式碼。
import UIKit
class ViewController: UIViewController {
@IBOutlet var scrollView: UIScrollView!
override func viewDidLoad() {
super.viewDidLoad()
scrollView.isScrollEnabled = false
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
廣告
資料結構
網路
關係型資料庫管理系統
作業系統
Java
iOS
HTML
CSS
Android
Python
C 語言程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP