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: PositionPosition 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: ThumbnailTypeA TumbnailType enum value that defines the type of the image thumbnail.
insets
var insets: NSDirectionalEdgeInsetsAn 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: BlazeWidgetItemImageContainerBorderStyleA BlazeWidgetItemImageContainerBorderStyle struct that defines the style of the border around the image.
cornerRadius
var cornerRadius: CGFloatA 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: BlazeWidgetItemImageGradientOverlayStyleA BlazeWidgetItemImageGradientOverlayStyle struct that defines the gradient configuration over the image.
animatedThumbnail
var animatedThumbnail: BlazeWidgetItemImageAnimatedThumbnailStyleAn object defining Animated Thumbnail behavior.
If used, please see the animated presets, for example BlazeWidgetLayout.Presets.StoriesWidget.Row.animatedThumbnailsCircles or BlazeWidgetLayout.Presets.VideosWidget.Row.horizontalAnimatedThumbnailsRectangles. The full list is on the BlazeWidgetItemImageAnimatedThumbnailStyle page.
- Note
animatedThumbnailis applicable only to Row widgets (Stories, Moments and Videos). Grid and single-item layouts don't play animated thumbnails.
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.
| Value | Description |
|---|---|
| topLeading | The image is positioned at the top leading corner. |
| topCenter | The image is positioned at the top center. |
| topTrailing | The image is positioned at the top trailing corner. |
| centerLeading | The image is positioned at the center leading edge. |
| center | The image is positioned at the center. |
| centerTrailing | The image is positioned at the center trailing edge. |
| bottomLeading | The image is positioned at the bottom leading corner. |
| bottomCenter | The image is positioned at the bottom center. |
| bottomTrailing | The image is positioned at the bottom trailing corner. |
ThumbnailType Enum
The ThumbnailType enum defines the type of the image thumbnail:
| Value | Description |
|---|---|
| squareIcon | Use the 1:1 thumbnail image defined as the thumbnail |
| verticalTwoByThree | Use the 2:3 thumbnail image defined as the thumbnail |
| custom | Use the main thumbnail image defined as a custom thumbnail |
Updated about 9 hours ago
