2

By default if you set a UITextField keyboard type to Number Pad when it is displayed, it appears without a keyline above the top keys (iOS10). Is there an easy way to resolve this?

enter image description here

cleverbit
  • 5,514
  • 5
  • 28
  • 38

1 Answers1

6

There are a few options, including adding a 1px UIView to the bottom of your layout (perhaps showing/hiding it based on the keyboard notifications), but by far the simplest solution is to add an empty toolbar as the UITextField's accessory view:

myTextField.inputAccessoryView = UIToolbar()

Which resolves the issue:

enter image description here

cleverbit
  • 5,514
  • 5
  • 28
  • 38