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

无人久伴 提交于 2019-12-20 02:26:27

问题


I need to show UIKeyboard with done button on top right corner ..please look into attached image..any help would be appreciated.


回答1:


This might help you. please check it out BSKeyboardControls




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/12421513/how-can-i-create-uikeyboard-with-done-button-on-top-right-corner

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