UITextView starts at Bottom or Middle of the text

后端 未结 19 1675
谎友^
谎友^ 2020-12-04 13:09

I\'ll get right to it. I have a UItextView placed in my view that when needs to scroll to see all the text (when a lot of text is present in the textView) the t

19条回答
  •  没有蜡笔的小新
    2020-12-04 13:16

    In Swift 2

    You can use this to make the textView start from the top:

    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
    
        myTextView.setContentOffset(CGPointZero, animated: false)
    }
    

    Confirmed working in Xcode 7.2 with Swift 2

提交回复
热议问题