Stop changing UITextField when customizing text

I have a view setup with setting 4 UITextFields and restriction settings so that it looks great on all devices and works as expected. I have a problem if, if I set the text using TextField.text = @ "some long text"; or [TextField setText: @ "some long text"]; this causes the text field to expand its width to fit the length of the text, and then due to restrictions that change other text fields as well.

How to stop resizing a text box? I would like the field to remain unchanged and the user can simply scroll through the text. If they want to get to the end?

thank

+4
source share
1 answer

You just need to change the restrictions. Give the UITextField an explicit internal Width constraint (or use the constraints to set or limit its width in some other way), and then everything will behave as you wish.

, . , ( ). , Interface Builder - , , , , , , , . , , - .

( 30, . , , UILabel, .)

+10

All Articles