Prevent editing of text in UITextField and hide cursor/caret/magnifying glass while using an inputView

后端 未结 6 1638
北荒
北荒 2021-02-13 01:40

How do I prevent the editing of text in a UITextField along with hiding the cursor/caret/magnifying glass, but still present the keyboard, as I am using an in

6条回答
  •  北恋
    北恋 (楼主)
    2021-02-13 02:31

    I hope this will helpful for you.

    Set cursor UIColor -> Empty. In UI, it will be hidden.

    [[self.textField valueForKey:@"textInputTraits"] setValue:[UIColor clearColor] forKey:@"insertionPointColor"];
    

提交回复
热议问题