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

前端 未结 5 1341
春和景丽
春和景丽 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条回答
  •  旧时难觅i
    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];
    

提交回复
热议问题