The centerAlignContent(), topAlignContent() and bottomAlignContent() functions were introduced during the beta of 1.5 but was also removed during the beta period. They were replaced with spacers.
Spacers add fixed or flexible spacing to a widget. Adding a spacer before other content in the widget, will push the content down to the bottom. This is equal to (the now removed) bottomAlignContent() function. Now if you instead added a spacer below the content, it would be pushed to the top, which is equal to topAlignContent().
Replacing these fairly straight forward functions with spacers might seem like an odd decision at first. Spacers are more complicated but also offer way more flexibility. For example, if you build a widget like this:
Text A
Spacer
Text B
Now you’ll get Text A aligned in the top and Text B aligned in the bottom. That wasn’t possible with the older functions.
This is just the top of the ice berg for spacers. They become much more important in the next update
I am very new to this and have a question or two. Would it be possible to create a widget that launched iOS apps? For example, if you just has a widget with a text list of apps and you click on the name of an app, could it then launch the app? Or would the text be too small for the phone to reliably know what text you are touching?
Right now I believe 3rd party apps can’t have their widgets have multiple tap targets. You could, on tap run a script or shortcut which then displays a menu of apps to open.
I’m glad you like it! You’re right that addText only allows single lines of text. This is a limitation of the Scriptable app itself. However, Simon did mention that horizontal layouts may come in the future, which would allow the layout you described (since text could theoretically be formatted individually in each column).
So, looking at the example widgets here, none of them do anything explicitly to refresh. (And I’m replying to you because you answered the question about refresh.)
I have two questions on this:
What sort of frequency should I expect? 15 mins, 1 hour? 10 seconds? I’m definitely not seeing the latter - and that’s OK.
If I have a widget with a button in it can pressing that button lead to a refresh?
And, since I mentioned a button, is it possible to simulate an array of buttons in a widget? Perhaps by use of an image I can tap on and whose tap coordinates can be queried?
The “array of buttons” thing would be good because it would enable me to cram more in than iOS natively allows.
(Looking at the docs I don’t see anything about interacting with a widget. So maybe the above isn’t feasible.)
with iOS 14.0.1 the behaviour of widgets has been improved and is more stable. Expect the widgets to refresh approximatley every 5 minutes. If your battery is low or your iPhone runs in low power mode, the update is less frequently.
no, afaik it’s not possible to refresh the widget’s content by pressing it or a button on it
Simon is implementing a feature which makes it possible to define more than one tap zone/button.
EDIT: It’s now available on the TestFlight beta.
As the widget is redrawn (and the script rerun then) by the system, you could store a value (to a file or the keychain) and use it to change the gradient…