Skip to main content
Version: 4.62

image

The image type can be used to creat an image layer. The provided value serves as the source of the image.

Field Configurations

KeyTypeDescriptionDefault Value
"additionalHeaders"AdditionalHeadersAdditional headers for the image requests. Will be ignored on assets and internal images.null
"fallbackImage"StringThe URL to the fallback image if no url or asset is provided.null
"filter"ImageFilterFilters to apply to the image. Filter negative is the only one available at the moment.null
"imageCruncher"ImageCruncherThe image cruncher configuration.null
"placeholder"StringIf set, this image will be shown until the actual image is loaded. This must be an internal image or asset!null
"placeholderFadeInDuration"NumberDuration for a fade in from the placeholder image to the actual image in milliseconds.0
"placeholderTint"StringTint for the placeholder image.null
"preload"BooleanIf preload is set to true, the image will still be downloaded, even when the image layer is hidden.false
"scaleType"ScaleTypeThe scale type to apply to the image."scaleAspectFit"
"tint"ColorTint for unicode characters to apply color and transparency.null
"value"ValueThe URL to the image. For asset images use asset://. For internal images use internal://.null

Inherited

From Base Layer

Base Layer

Field Configurations

KeyTypeDescriptionDefault Value
"_value"Value[PREVIEW] Dynamic value of the layer.null
"accessibilityAppendState"StringDefines this layer appends its state to the accessibility text.null
"accessibilityText"StringText for accessibility navigation. Can be translated.null
"actions"ActionListList of actions, which will be executed when the layer is tapped.null
"borderColor"ColorThe color of the border in hex color value.null
"borderRadius"UnitSizeThe radius applies to all corners; with a borderWidth of 0 the border is not drawn and radius is set anyway.0
"borderWidth"UnitSizeThe width of the border.0
"bottomLeftRadius"UnitSizeRadius for the bottom left corner.0
"bottomRightRadius"UnitSizeRadius for the bottom right corner.0
"classes"ArrayList of classes for layer styles.null
"conditions"ConditionsList of conditions to alter the layer state.null
"constraints"ConstraintsA list of constraints defining the position of the layer in a layout.null
"consumesKeyboard"BooleanThis layer will be used to shrink, if a keyboard is shown.null
"dataKey"StringName for assigning data to this layer.null
"focusColor"ColorThe highlight color of this layer when it is focused. Mainly used on TV. If no color is provided, the pressedColor will be used.null
"hidden"BooleanIndicates whether the layer is hidden. Default: false.false
"isAccessibilityElement"StringDefines if this layer is important for accessibility navigation. The default depends on the layer type.null
"layerRotation"NumberThe layer is rotated by the specified degree.0
"name"StringUnique name in the layout. Used for alignment or actions.null
"opacity"NumberThe opacity of the layer.1
"overInsetBottom"BooleanDetermines if this layer ignores the save space at the bottom of the device.false
"overInsetTop"BooleanDetermines if this layer ignores the save space at the top of the device.false
"pressedColor"ColorThe highlight color of this layer when it is pressed. Mainly used on TV. If no color is provided, the focusColor will be used.null
"safeArea"SafeAreaTypeObjectDetermines the safe area behaviour.null
"shadowElevation"NumberThe elevation of this layer for casting shadows.0
"state"StringThe state the layer will use as default."default"
"states"LayerStatesA list of named states that affect the appearance of the layer.null
"topLeftRadius"UnitSizeRadius for the top left corner.0
"topRightRadius"UnitSizeRadius for the top right corner.0
"touchFeedback"TouchFeedbackDetermines if the layer should show a touch feedback if touched."visible"
"trackingKey"StringDefines a key for a scroll event.null
"type"LayerTypeThe type of the layernull
"value"Value(Initial) value of the layer.null

Examples

Example 1: Normal and animated images

Show ExampleHide Example

The image layer supports different image file types.

{
"type": "image",
"value": "asset://dog.jpg",
"scaleType": "scaleAspectFill"
}
{
"type": "image",
"value": "https://samples.mobilitysuite.de/heart_tunnel.gif",
"scaleType": "scaleAspectFill"
}
The app showing the results of the sample code from Example 1.The app showing the results of the sample code from Example 1.

The value can also refer to a hosted image instead of using assets.

Example 2: Different scaleTypes

Show ExampleHide Example

The behavior of the same image when using different scaleTypes.

{
"type": "image",
"value": "asset://cat.jpg",
"scaleType": "scaleAspectFill"
}
{
"type": "image",
"value": "asset://cat.jpg",
"scaleType": "scaleAspectFit"
}
{
"type": "image",
"value": "asset://cat.jpg",
"scaleType": "scaleToFill"
}
The app showing the results of the sample code from Example 2.The app showing the results of the sample code from Example 2.

Example 3: Internal images

Show ExampleHide Example

Internal images are provided by the operating system and therefore vary in style depending on the device used.

{
"type": "image",
"value": "internal://profile"
}
{
"type": "image",
"value": "internal://home",
"tint": "#bf4797"
}
{
"type": "image",
"value": "internal://share",
"tint": "#2f96b4"
}
The app showing the results of the sample code from Example 3.The app showing the results of the sample code from Example 3.

The tint field can be used to change the color of monochrome images such as internal images.

List of available internal images

  • internal://alarm
  • internal://appicon
  • internal://back
  • internal://bookmark
  • internal://bookmark-active
  • internal://calendar
  • internal://call
  • internal://chat
  • internal://check
  • internal://close
  • internal://copy
  • internal://email
  • internal://error
  • internal://erroricon
  • internal://favorite
  • internal://favorite-active
  • internal://filter
  • internal://forward
  • internal://go-forward
  • internal://home
  • internal://location-disabled
  • internal://location-enabled
  • internal://menu
  • internal://mic
  • internal://mic-mute
  • internal://mute
  • internal://navigation
  • internal://next
  • internal://noconnectionicon
  • internal://pause
  • internal://placeholder
  • internal://play
  • internal://previous
  • internal://profile
  • internal://remove
  • internal://rewind
  • internal://save
  • internal://scan
  • internal://search
  • internal://send
  • internal://settings
  • internal://share
  • internal://stop
  • internal://sync
  • internal://syncanimated
  • internal://thumbsdown
  • internal://thumbsup
  • internal://volume
  • internal://volume-down
  • internal://volume-up
  • internal://warning
  • internal://zoom-plus