I tried to rebuild the UITextField
from Apple's "Phone" app.
I built a numpad where each button triggers a certain value (0-9, #, *) and appends it to the text field's text.
The textAlignment
property is set to center
. However, when inserting numbers, the text field does not scroll or move to the last character.
F.ex., if there're more than 10 numbers and I'm adding the eleventh number, that one won't be displayed because it's off the screen.
Apple handles this issue by first shrinking the font size and then scrolling to the cursor position.
Is there a simple trick to achieve the same result?
I attached two images.