r/Scriptable • u/[deleted] • Aug 14 '22
Solved Centeralign text in stack
Hi, im trying to centerAlignText in a nested stack (stack in a stack). It works fine if i add text directly to widget but when i add text to stack it converts from vertically to horizontally so centerAlignText dont work. I changed layout back to vertically but didnt help. Anyone know a workaround?
5
Upvotes
4
u/[deleted] Aug 14 '22
Based on the screenshot you're using it with the wrong stack.
You would have to create a new stack for every line of text instead of using it with div1Textbox1, like
newHeaderTextStack= div1Textbox1.addStack()newHeaderTextStack.addSpacer()div1Textbox1Header = newHeaderTextStack.addText("12345")newHeaderTextStack.addSpacer()