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 BlazeWidgetLayout.Presets.MomentsWidget.Row.verticalAnimatedThumbnailsRectangles preset.
- Note
animatedThumbnailis 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.
| 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 11 days ago
