Reputation: 919
Autosize increase UITextview is not working, in this case, please help me.
This is my code for increase Textview:
func textViewDidChange(_ textView: UITextView) {
constTextview.constant = textView.contentSize.height
}
constTextview is Height Outlet for Textview height.
After pest 3 lines Textview inner scroll is not working. Please check GIF.
Upvotes: 0
Views: 117
Reputation: 919
This solution working in my case:
constTextview is Height constraint of my Textview.
@IBOutlet var constTextview: NSLayoutConstraint!
func textViewDidChange(_ textView: UITextView) {
constTextview.constant = textView.contentSize.height
textView.beginFloatingCursor(at: CGPoint.zero)
textView.endFloatingCursor()
}
Upvotes: 1