phnmnn
phnmnn

Reputation: 13260

iOS - Prevent UITextView from showing the “Done” button and keyboard

I use "selectable" and not "editable" UITextView to show attributed text.

textView.attributedText = attributedString;
textView.scrollEnabled = NO;
textView.backgroundColor = [UIColor clearColor];
textView.editable = NO;
if (@available(iOS 11.0, *)) {
    [textView.textDragInteraction setEnabled:NO];
}
textView.textContainerInset = UIEdgeInsetsZero;
textView.textContainer.lineFragmentPadding = 0;

The weird issue is that sometimes when I select a text the "done" button is pop up. enter image description here

Another weird issue is appearing of keyboard when I open App Switcher.

enter image description here

How to keep textView be selectable and not editable, but prevent any kind of keyboard related staff from showing?

Upvotes: 0

Views: 36

Answers (1)

phnmnn
phnmnn

Reputation: 13260

Problem caused by https://github.com/hackiftekhar/IQKeyboardManager framework. After removing everything is fine

Upvotes: 0

Related Questions