ztk::ios::Label
Makes a text (UILabel) that wraps at the width of its column.
Synopsis
ztk::ios::Label new ?OPTION VALUE ...?
$screen add label ?OPTION VALUE ...?
Arguments
| Name |
Type |
Default |
Meaning |
-text |
text |
empty |
The text. |
-font |
text style |
body |
The text style of Dynamic Type: largeTitle, title, title2, title3, headline, subheadline, body, callout, footnote, caption, or caption2. The size follows the setting of the system. |
-color |
color |
label |
A color of UIColor by its name with no Color, such as label, secondaryLabel, systemBlue, or systemRed, or #RRGGBB. |
-lines |
integer |
0 |
The most lines of the text. 0 is no limit. |
-align |
natural, left, center, right |
natural |
The alignment of the text. natural follows the direction of the language. |
-hidden, -accessibilityLabel, -accessibilityHint |
option |
|
As for each view (ztk::ios). |
configure, cget, destroy |
method |
|
As for each object (ztk::ios). |
Return value
new gives the object.
Errors
| Error |
When |
bad font "NAME": must be body, callout, caption, caption2, footnote, headline, largeTitle, subheadline, title, title2, or title3 |
-font has another value. |
bad color "NAME": must be a color of the system, such as label or systemBlue, or #RRGGBB |
UIColor has no color of that name. |
expected integer but got "X" |
-lines is no integer. |
bad align "X": must be center, left, natural, or right |
-align has another value. |
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::Label |
| Headless |
No: the namespace does not exist. |
Example
set screen [ztk::ios::Screen new -title Note]
$screen add label -text "Saved." -font headline -color systemGreen -align center
ztk::ios::app root $screen
See also