Skip to main content
Solved

Constraining text to shapes

  • January 26, 2022
  • 3 replies
  • 7228 views

Liam_Kavanagh

I’m struggling with this component. I’ve created auto-layout with hug contents and packed settings. If I add enough characters to line 1 so that it pushes the rest of the items down, I’d like the gray square to resize itself so that the margins are constant. How can I do this?

Best answer by ntfromchicago

If I’m understanding your use case, you want the box to grow vertically if you add more lines of text? If so, you just need two things:

  1. Your parent frame (the gray box) to be Auto Layout and set to “hug contents” vertically.

  2. Your text boxes to be set to “Auto Height” in the font settings.

I see that you have a “Frame 1” in your layout which doesn’t seem necessary and could be causing the trouble you’re seeing. With Auto Layout you can just have the four lines of text separately; no need to put all four in a smaller frame.

View original
This topic has been closed for comments

3 replies

ntfromchicago
  • New Member
  • 287 replies
  • Answer
  • January 27, 2022

If I’m understanding your use case, you want the box to grow vertically if you add more lines of text? If so, you just need two things:

  1. Your parent frame (the gray box) to be Auto Layout and set to “hug contents” vertically.

  2. Your text boxes to be set to “Auto Height” in the font settings.

I see that you have a “Frame 1” in your layout which doesn’t seem necessary and could be causing the trouble you’re seeing. With Auto Layout you can just have the four lines of text separately; no need to put all four in a smaller frame.


Liam_Kavanagh

Thanks so much for the help!


  • 0 replies
  • February 26, 2022

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


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