UITextView is not scrolled to top when loaded

后端 未结 12 1305
别跟我提以往
别跟我提以往 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条回答
  •  孤街浪徒
    2020-12-03 03:04

    If you don't wanna mess with constraints:

    override func updateViewConstraints() {
        super.updateViewConstraints()
    }
    
    override func viewDidLayoutSubviews() {
        self.textLabel.setContentOffset(CGPointZero, animated: false)
    }
    

提交回复
热议问题