how to disable uikeyboard of textview ,if the editing mode enabled

前端 未结 5 1331
春和景丽
春和景丽 2021-01-20 05:07

How to hide/disable keyboard ,if the textview editing is enabled.

I only want to that user can only be able to select the text and can\'t be allowed for entering tex

相关标签:
5条回答
  • 2021-01-20 05:56

    try this

    yourtextview.UserinterationEnable=No;

    0 讨论(0)
  • 2021-01-20 05:57

    ok just uncheck the behavior of you UItextview in .xib file.

    0 讨论(0)
  • 2021-01-20 05:58

    Something to try it the 'editable' setting doesn't work out is to create a UIView that's hidden and out of the way somewhere and assign it as the inputView for the text view. If that property is non-nil, the view it contains will be shown instead of the keyboard.

    Such as:

    self.textView.inputView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)] autorelease];
    
    0 讨论(0)
  • 2021-01-20 06:01

    uitextview.editable = NO; or set checkmark in IB. It will allow to select text with options - Copy and Select All without keyboard appearing. Tap on the word and hold to select text.

    0 讨论(0)
  • 2021-01-20 06:06

    This will make the keyboard disappear:

    [[[UIApplication sharedApplication] keyWindow] endEditing:YES];
    

    This what you want to do?

    0 讨论(0)
提交回复
热议问题