0

I have a symbol with an icon and text. The text is a specific distance from the icon. Together the icon and text are grouped, and center aligned to the symbol artboard. Anyone have a tip on how to use the text override function so that if I change the text to something longer or shorter the objects in the symbol will stay center aligned. Otherwise I have to constantly Detach from Symbol, which is annoying!

Thanks!

1

I have the same problem. currently solved it with the Auto Layout Plugin by Anima which works like a charm when working alone on a project. Trying to figure out a way without using a plugin currently so it can be shared with anybody using the symbol (especially now with shared libraries) without the need of installing the Auto Layout plugin.

0

Currently, our team uses Auto Layout for this in conjunction with the "Button" plugin that allows us to overwrite the button's text and adjusting the button size automagically.

0

This problem is solved by the introduction of "smart layout" in the latest sketch update "Sketch 58".

Choose whether your Symbol resizes horizontally or vertically, you’ll need to set which direction it resizes from (think of it a bit like text alignment). You can choose from the following layout properties:

Vertical:

  1. Top to Bottom
  2. Bottom to Top
  3. From Middle

Horizontal:

  1. Left to Right
  2. Right to Left
  3. From Center

Image showing the layout controls.enter image description here

To know more about the other added features you can check the sketch documentation.

-1

I don't know why this works, but it works and it's fully native in Sketch without a plugin: https://medium.com/sketch-app-sources/sketch-hacks-make-a-resizable-button-with-icon-label-totally-native-edition-6a1ff5b48e0e

  • 2
    Hi Polly, welcome to GDSE and thanks for your answer. While the article in the link might answer the question, we prefer to have the gist of the technique in the actual answer. That way, if the article ever gets deleted, your answer is not useless. Could you edit your answer to add the relevant details? Feel free to leave more answers, ask a question of your own, and upvote quality content. – PieBie Sep 20 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.