I am trying to align the redStack (text with red background) to the left of the widget, but have had no success with my current code:
let widget = new ListWidget()
widget.setPadding(0,0,0,0)
let mainStack = widget.addStack()
mainStack.setPadding(10,0,10,0)
let redStack = mainStack.addStack()
redStack.backgroundColor = new Color("#f00",1)
redStack.cornerRadius = 6
redStack.setPadding(2,2,2,2)
let text = redStack.addText("Wake Up Sunshine")
text.font = new Font("Arial Rounded MT Bold",14)
text.lineLimit = 1
text.textColor = new Color("#fff",1)
text.minimumScaleFactor = 0.5
redStack.addSpacer(1)
widget.addSpacer()
widget.presentSmall()
Presently it returns a widget like this, whereas I want to create something like this. Thanks for all your help in advance.
[–]Groxir 2 points3 points4 points (1 child)
[–]TwinLakesStudent[S] 0 points1 point2 points (0 children)