In a UITextView
have a text which is for readonly and dont want any userinteraction at all means dont want text to be edited and even dont want keyboard to showup. I want to make UITextView
scrollable.
Right now what happening is that it is not scrollable and the content is editable and keyboard shows up and bottom wall of the border is not showing. If anyone can help me with this issue. Will appreciate it so much.
Thanks in advance.
Set the editable / isEditable property to NO / false.
Swift 3, 4:
textView.isEditable = false
Swift 1, 2:
textView.editable = false
Objective-C:
textView.editable = NO;
textView.editable = NO;
It's mentioned in the documentation.
And about the scrolling; Your UITextView will scroll when the content size exceeds the frame size of your UITextView.
textview.editable = false // for swift language
textview.selectable = false //
// override textview delegates
func textViewShouldBeginEditing(textView: UITextView) -> Bool {
return false
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With