UITextField's width is never less than it's width with placeholder text

Viewed 640

I have a UITextField and UILabel sitting together in a UIView as so:

hand-drawn rendition of the layout

and here it is in Xcode:

screenshot of layout in Xcode

The label is hidden until the user enters some text into the text field, so it serves to provide a persistent "suffix" to the numeric entry. The problem is that when the user types a number into the text field, it doesn't shrink down to the size of the text, it remains at the size of the original placeholder, even though it isn't visible, as so:

screenshot of the problem

Is there any way I can constrain the text field's width to be the minimum size to accommodate the user's text, and not pay attention to the invisible placeholder text's width?

Thank you

1 Answers
Related