GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

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

PropertyTypeDescription
isVisibleBoolWhether the subtitle is visible.
topSpacingCGFloatThe spacing above the subtitle, separating it from the title.
unreadStateBlazeWidgetItemTextStyleThe subtitle text style when the item is in an unread state.
readStateBlazeWidgetItemTextStyleThe 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 position and insets (see BlazeWidgetItemTitleStyle), even when the title itself is hidden. The subtitle has no position or horizontal insets of its own.
  • topSpacing only 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, isVisible has 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:

PropertyDefault
isVisiblefalse
topSpacing3
fontSystem font, 11 pt, regular
textColor#BABABA
lineHeight13
numberOfLines1
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 = .gray

Did this page help you?