UITextView is not scrolled to top when loaded

后端 未结 12 1256
别跟我提以往
别跟我提以往 2020-12-03 02:39

When I have text that does not fill the UITextView, it is scrolled to the top working as intended. When there is more text than will fit on screen, the UITextView is scrolle

12条回答
  •  萌比男神i
    2020-12-03 03:05

    Swift

    override func viewDidLoad() {
        super.viewDidLoad()  
        textView.isScrollEnabled = false  
    }
    
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        textView.isScrollEnabled = true
    }
    

提交回复
热议问题