how to change the length of text field

In the Attributes inspector, type the

8
in Spacing field. Press Return. after I did it. I can't change the length of the text field.

Replies

In the Attributes inspector, type the

8
in Spacing field


Attributes inspector of which object ? Spacing field of what ? There is no spacing field attribute for UITectField.

Do you speak of a stackView where textField is ?

Do you want to change the length or the width ?


So explain better what you did, what you expect and what you get.

  1. attributes inspector of label、text field and button.
  2. the vertical spacing field of label、text field and button.
  3. when I set the vertical spacing field of label、text field and button. and I solo selected the label and drag the frame of the label. I can't change the length of the text field.
  4. I want the text field frame longer after I set the vertical spacing field of label、text field and button.

When I open the attributes inspector (XCode 10.3) for a UILabel, I do not get vertical spacing field in any of the items.

There are 2 areas: Label and View, where there are Stretching fields, but no vertical spacing.


Are you sure you speak of Attributes inspector (selected with the down mointing arrow) ? And not another inspector or of constraint to other object.

yes, I am sure. it is the attributes inspector.

first, I selected the three items then I click the stack view button. in the stack view menu, the option of axis selected the vertical. the option of spacing type 8 then the three items vertical distance changed.

Well, you have included the textFields or buttons in a stackView.


That was precisely my question.

Vertical spacing relates to the stackView.


The width is automatically computed in a stackView ; so you cannot force the width (what you call length) of an individual component.


I may miss something, but I do not see why changing the vertical spacing wouyld change the length. Maybe reducing horizontal spacing could have an effect, but not vertical.