Deta362
December 30, 2020, 10:55pm
1
Hi,
I am working on a weather script that shows a 3-day forecast (building upon @grantavery script )
Is it possible to center align the content in each stack? (dailyWeatherStack - code here ). Currently the content is left aligned and using spacers doesn’t center align each item with each other?
sylumer
December 30, 2020, 11:40pm
2
Maybe Simon’s original example around stacks here will help?
The latest TestFlight beta build adds support for stacks and links / tap targets in widgets. Here’s a few examples on how to use the new features.
Please note that as of writing this, some of the APIs used in the following example scripts have not been released on the App Store. You can join the beta through TestFlight if you want to try it out now. As always with Scriptable’s betas, the new APIs might change through the beta. That said, I’m pretty happy with where the APIs are right now
Join …
In it he has text above and below three images and everything aligned in one way or another.
Deta362
December 31, 2020, 8:45am
3
Thanks, yes I checked those examples but all show text left aligned and not centered?
sylumer
December 31, 2020, 9:43am
4
There’s a thread on Reddit about centering text in a stack.
This example from that thread centres the text.
https://pastebin.com/raw/TdZ5WfM9
Deta362
December 31, 2020, 6:21pm
5
Great that fixed it, thanks!