How can I create UIKeyboard with done button on top right corner?

强颜欢笑 提交于 2019-12-01 21:41:49

This might help you. please check it out BSKeyboardControls

Create a UIToolbar keep two bar buttons in that. Initially Hide that toolbar.

Show the toolbar on the textfield didBeginEditing delegate of textfield

and hide the toolbar in didEndEditing delegate of textfield

EDIT: As prashant said BSKeyboard offers what i said. See the look and feel of it here http://www.cocoacontrols.com/platforms/ios/controls/bskeyboardcontrols

You should set inputAccessoryView propery of UITextField or UITextView to your custom view with all required buttons

@property(readwrite, retain) UIView *inputAccessoryView

Description
The custom accessory view to display when the text field becomes the first responder The default value of this property is nil. Assigning a view to this property causes that view to be displayed above the standard system keyboard (or above the custom input view if one is provided) when the text field becomes the first responder. For example, you could use this property to attach a custom toolbar to the keyboard.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!