Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide an iOS numeric keyboard

I'm using a numeric keyboard for input from a UITextField. I noticed that Interface Builder has a return key property called "Done". When I select "Done" under the return key options, I do not see that a Done button is created on the numeric keyboard. I see the "Done" button on other keyboard types if I change it from a numeric keyboard to something else, but not when using a numeric keyboard.

  • I want to create a "Done" button on the keyboard which will hide the keyboard when pressed
  • I want to do this because of the amount of real estate the keyboard takes up
  • I'm very new to iOS development, so the easiest and least convoluted way to accomplish this goal would be appreciated

Thanks in advance!

like image 455
Skizz Avatar asked Feb 21 '23 10:02

Skizz


1 Answers

The typical way of doing this is to assign a toolbar containing a button to the inputAccessoryView property of the text view.

like image 119
Jim Avatar answered Mar 02 '23 11:03

Jim