Mobile app version of vmapp.org
Login or Join
Kimberly620

: How to add text in center of a rectangle Sketch I am new to sketch and I really want to know there is anything like Button. In order to draw a button, I first draw a rectangle shape then

@Kimberly620

Posted in: #SketchApp

I am new to sketch and I really want to know there is anything like Button. In order to draw a button, I first draw a rectangle shape then I draw text on rectangle layer but I find it's very difficult to align text center in the rectangle.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Kimberly620

1 Comments

Sorted by latest first Latest Oldest Best

 

@Kaufman565

For this specific case it seems best if you create the button like in the video I'm sharing:



create a rectangle
create a text box with a number in it & make it as big as the rectangle. if it's 'auto', set it as 'fixed'
make the text centered vertically and horizontally


when you select both layers and resize, the text will always remain in the center

bonus:
make it a symbol, copy/paste it as many times as you want and use the symbol overrides to change the number. this way, when you change the style/color/font in the symbol, it'll change throughout.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme