BlazeWidgetItemDescriptionStyle - iOS
BlazeWidgetItemDescriptionStyle defines the description line of a Moments widget item: whether it shows, the spacing above it, and its text styles for the unread and read states. The line shows the moment's description from its metadata.
Properties
| Property | Type | Description |
|---|---|---|
| isVisible | Bool | Whether the description is visible. |
| topSpacing | CGFloat | The spacing above the description, separating it from the line above it (the subtitle, or the title when the subtitle is hidden). |
| unreadState | BlazeWidgetItemTextStyle | The description text style when the item is in an unread state. |
| readState | BlazeWidgetItemTextStyle | The description text style when the item is in a read state. |
How it's laid out
- The title, subtitle, and description form one text block, always in that order. The block is placed with the title's
positionandinsets(see BlazeWidgetItemTitleStyle), even when the title itself is hidden. The description has no position or horizontal insets of its own. topSpacingonly applies below a visible line. If neither the title nor the subtitle is shown, the description starts at the top of the block.- A visible description with no text for an item takes no space.
- Only Moments widgets show a description. On Stories and Videos widgets,
isVisiblehas no effect. - Basic formatting in the text, such as bold and italic, is kept. Links are shown as plain text.
Default values
All presets hide the description. The Moments presets use these values for both unreadState and readState:
| Property | Default |
|---|---|
| isVisible | false |
| topSpacing | 3 |
| font | System font, 11 pt, regular |
| textColor | #BABABA |
| lineHeight | 13 |
| numberOfLines | 1 |
| alignment | .natural |
Customize the description style
You don't create a BlazeWidgetItemDescriptionStyle directly. Start from a Moments layout preset, then modify the description on the widget item before you pass the layout to initWidget:
var layout = BlazeWidgetLayout.Presets.MomentsWidget.Row.verticalRectangles
layout.widgetItemStyle.description.isVisible = true
layout.widgetItemStyle.description.topSpacing = 4
layout.widgetItemStyle.description.unreadState.textColor = .lightGray
layout.widgetItemStyle.description.readState.textColor = .grayUpdated 14 days ago
Did this page help you?
