0

all! I have a textView. When I want to type a text, a keyboard appears. And when I press a return key, text is going to the new line. It is standard function of a textView in Xcode. And I want it to be so. But in order to close a keyboard I want the toolbar with a button "Close "upon the keyboard appear. How can I do that?Can you help with code or give links to some good tutorials?

1 Answers1

0

You accomplish this by setting an inputAccessoryView.

The easiest thing would either be a UIView with a UIButton in it or a UIToolbar with a UIBarButtonItem in it.

This answer has some example code to do exactly this.

Community
  • 1
  • 1
Dima
  • 23,484
  • 6
  • 56
  • 83