{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

RotateKt

public final class RotateKt


Summary

Public methods

static final @NonNull Modifier
rotate(@NonNull Modifier receiver, float degrees)

Sets the degrees the view is rotated around the center of the composable.

Public methods

rotate

public static final @NonNull Modifier rotate(@NonNull Modifier receiver, float degrees)

Sets the degrees the view is rotated around the center of the composable. Increasing values result in clockwise rotation. Negative degrees are used to rotate in the counter clockwise direction

Usage of this API renders this composable into a separate graphics layer.

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.unit.dp

Box(
    Modifier.rotate(45f)
        .size(100.dp, 100.dp)
)
See also
graphicsLayer

Example usage: