Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITextField inputView displays undo, redo, paste buttons

I have created a custom inputView for my UITextField. The view itself looks and functions great, but on the iPad I'm getting undo, redo, and paste buttons above my custom inputView. How do I remove those buttons? They don't have any functionality, but they should be removed.

enter image description here

like image 866
Mike Walker Avatar asked Nov 02 '15 22:11

Mike Walker


2 Answers

With Swift 3 and XCode 8 I was able to remove the bar by removing the two button groups on the text field input:

self.textField.inputAssistantItem.leadingBarButtonGroups.removeAll()
self.textField.inputAssistantItem.trailingBarButtonGroups.removeAll()
like image 51
Retebitall Avatar answered Nov 16 '22 20:11

Retebitall


// hide undo, redo, paste button bar for textfield input view
UITextInputAssistantItem* item = [your_textfield inputAssistantItem];
item.leadingBarButtonGroups = @[];
item.trailingBarButtonGroups = @[];

will hide the top bar for input view.

Reference:How to hide the shortcut bar in iOS9

like image 7
Yuchao Zhou Avatar answered Nov 16 '22 21:11

Yuchao Zhou