I'm wondering how to disable the inputview of a UITextfield. Setting textField.inputView = nil;
or [textField setInputView:nil]
in ShouldBeginEditing doesn't do anything, and using the userInteraction
property removes the ability to interact with the field. Ideally, I'd like to remove both the cursor and the keyboard while still being able interact with and switch between textfield methods, using ShouldBeginEditing and ShouldEndEditing. Is there any way to accomplish this?
Disable Keyboard for UITextfield
1.4k views Asked by DOLOisSOLO At
2
You should do this:
Setting it to
nil
just means the default keyboard is used.To get rid of the caret, subclass the UITextField and override
caretRectForPosition
: