GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

BlazeWidgetItemImageStyle - iOS

The BlazeWidgetItemImage struct is responsible for defining the appearance and layout of the image within a widget item. It includes properties for positioning, size, thumbnail type, and border customization.

Properties

position

var position: Position

Position enum value that defines the position of the image within the widget item.

This applies only when the image has an absolute value.

thumbnailType

var thumbnailType: ThumbnailType

A TumbnailType enum value that defines the type of the image thumbnail.

insets

var insets: NSDirectionalEdgeInsets

An NSDirectionalEdgeInsets value that defines the insets for the image within the widget item.

width

var width: CGFloat?

An optional CGFloat value that defines the width of the image.

Set to nil for automatic sizing.

height

var height: CGFloat?

An optional CGFloat value that defines the height of the image.

Set to nil for automatic sizing.

ratio

var ratio: CGFloat?

An optional CGFloat value that defines the aspect ratio of the image.

Set to nil for automatic sizing.

If the Ratio is provided along with height/width, sets the image with absolute size.

border

var border: BlazeWidgetItemImageContainerBorderStyle

A BlazeWidgetItemImageContainerBorderStyle struct that defines the style of the border around the image.

cornerRadius

var cornerRadius: CGFloat

A CGFloat value that defines the corner radius of the image.

cornerRadiusRatio

var cornerRadiusRatio: CGFloat?

The corner radius ratio of the image container.

The corner radius ratio is a value between 0.0 and 1.0, which computes the final corner radius for the image. Overrides corner radius property.

For example, a value of 0.5 on a 1:1 width/height widget item will result in a perfect circle appearance for the image.

gradientOverlay

var gradientOverlay: BlazeWidgetItemImageGradientOverlayStyle

A BlazeWidgetItemImageGradientOverlayStyle struct that defines the gradient configuration over the image.

animatedThumbnail

var animatedThumbnail: BlazeWidgetItemImageAnimatedThumbnailStyle

An object defining Animated Thumbnail behavior.
If used, please see the BlazeWidgetLayout.Presets.MomentsWidget.Row.verticalAnimatedThumbnailsRectangles preset.

  • Note animatedThumbnail is applicable only to Moments Row widgets. Any usage on any other scope will result in a no-op.

Position Enum

The Position enum provides predefined positions for the image within the widget item and Applies only when the image has an absolute value.

ValueDescription
topLeadingThe image is positioned at the top leading corner.
topCenterThe image is positioned at the top center.
topTrailingThe image is positioned at the top trailing corner.
centerLeadingThe image is positioned at the center leading edge.
centerThe image is positioned at the center.
centerTrailingThe image is positioned at the center trailing edge.
bottomLeadingThe image is positioned at the bottom leading corner.
bottomCenterThe image is positioned at the bottom center.
bottomTrailingThe image is positioned at the bottom trailing corner.

ThumbnailType Enum

The ThumbnailType enum defines the type of the image thumbnail:

ValueDescription
squareIconUse the 1:1 thumbnail image defined as the thumbnail
verticalTwoByThreeUse the 2:3 thumbnail image defined as the thumbnail
customUse the main thumbnail image defined as a custom thumbnail

Did this page help you?