Function

ForcedSize

A [DeviceConfigurationOverride] that overrides the available size for the contained content.

ForcedSize

Common
expect fun DeviceConfigurationOverride.Companion.ForcedSize(
    size: DpSize
): DeviceConfigurationOverride

A DeviceConfigurationOverride that overrides the available size for the contained content.

This is only suitable for tests, since this will override LocalDensity to ensure that the size is met (as opposed to Modifier.requiredSize which will result in clipping).

Parameters

size the DpSize to force the contained content to render in, changing density if necessary

Returns

a DeviceConfigurationOverride that forces the content size.

ForcedSize

Android
actual fun DeviceConfigurationOverride.Companion.ForcedSize(
    size: DpSize
): DeviceConfigurationOverride