BlazeWidgetItemSubtitleStyle - iOS
BlazeWidgetItemSubtitleStyle defines the subtitle 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 subtitle from its metadata.
Properties
| Property | Type | Description |
|---|---|---|
| isVisible | Bool | Whether the subtitle is visible. |
| topSpacing | CGFloat | The spacing above the subtitle, separating it from the title. |
| unreadState | BlazeWidgetItemTextStyle | The subtitle text style when the item is in an unread state. |
| readState | BlazeWidgetItemTextStyle | The subtitle 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 subtitle has no position or horizontal insets of its own. topSpacingonly applies below a visible line. If the title is hidden, the subtitle starts at the top of the block.- A visible subtitle with no text for an item takes no space, and the description moves up.
- Only Moments widgets show a subtitle. 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 subtitle. 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 subtitle style
You don't create a BlazeWidgetItemSubtitleStyle directly. Start from a Moments layout preset, then modify the subtitle on the widget item before you pass the layout to initWidget:
var layout = BlazeWidgetLayout.Presets.MomentsWidget.Row.verticalRectangles
layout.widgetItemStyle.subtitle.isVisible = true
layout.widgetItemStyle.subtitle.topSpacing = 4
layout.widgetItemStyle.subtitle.unreadState.textColor = .lightGray
layout.widgetItemStyle.subtitle.readState.textColor = .grayUpdated 14 days ago
Did this page help you?
