Skip to main content
Question

Resizing child element in a component


Angela Liu

I created this form field. I want the field length to be adjustable, while keeping the button the same size and at the end. However, when I resize the field, one of two things will happen:

 

Button stays the same size, but doesn’t move to be at the end of the field.

 

Button moves, but changes size.

 

How should the component be set so that the button has a fixed size but dynamic position?

3 replies

Raphael_M
  • Active Member
  • 315 replies
  • March 12, 2025

There are plenty of ways to do it.

 

If your button layout is using the autolayout, set the button component’s height and width to hug,

 

then on your textfield component, if you’re using autolayout just put the Input container’s width into fill

 

 

the entire textfield component is also in autolayout with this structure:

 

 

that should do it.

 


Angela Liu
  • Author
  • New Member
  • 3 replies
  • March 12, 2025

@Raphael_M button is set to hug, but the fill option isn’t showing up for the input container.


Raphael_M
  • Active Member
  • 315 replies
  • March 13, 2025

Set the Standard Form Field to fill.

 

Another option is to remove the autolayout on your component and then set the constraints of the button to right and the standard form field to left. Normally, I don’t put texts on hug so that it’ll automatically adjust it’s height.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings