ztk::ios::Stack
Makes a row or a column of views (UIStackView).
Synopsis
ztk::ios::Stack new ?OPTION VALUE ...?
$screen add stack ?OPTION VALUE ...?
Arguments
| Name |
Type |
Default |
Meaning |
-axis |
vertical, horizontal |
vertical |
A column or a row. |
-spacing |
number |
8 |
The points between views. |
-alignment |
fill, leading, center, trailing |
fill |
The place of each view across the axis. |
add KIND ?OPTION VALUE ...? |
method |
|
As for a screen: makes a control and puts it at the end. |
views |
method |
|
Gives the controls of add that exist, in their order. |
-hidden, -accessibilityLabel, -accessibilityHint |
option |
|
As for each view (ztk::ios). |
configure, cget, destroy |
method |
|
As for each object (ztk::ios). |
Return value
new and add give the new object. views gives a list. destroy also frees the controls of add.
Errors
| Error |
When |
bad axis "X": must be horizontal or vertical |
-axis has another value. |
expected number but got "X" |
-spacing is no number. |
bad alignment "X": must be center, fill, leading, or trailing |
-alignment has another value. |
bad kind "KIND": must be button, datepicker, label, stack, switch, textfield, or textview |
add has another kind. |
unknown option "-X": must be ... |
Another option. |
| Platform |
Works |
| Windows |
No |
| macOS |
No |
| Linux, Wayland |
No |
| Linux, X11 |
No |
| Web |
No |
| iOS |
Yes |
| Android |
No: ztk::android::Stack |
| Headless |
No: the namespace does not exist. |
Example
set screen [ztk::ios::Screen new -title Settings]
set row [$screen add stack -axis horizontal -spacing 12 -alignment center]
$row add label -text "Daily reminders"
$row add switch -on 1
ztk::ios::app root $screen
See also