Function

DrawAnnotation

Creates an ad-hoc DrawAnnotation from drawBehind and drawOver lambdas.

DrawAnnotation

Source set: Common
public fun DrawAnnotation(
    drawBehind: (DrawAnnotationScope.() -> Unit)? = null,
    drawOver: (DrawAnnotationScope.() -> Unit)? = null,
): DrawAnnotation

Creates an ad-hoc DrawAnnotation from drawBehind and drawOver lambdas.

Note: Lambda-backed DrawAnnotation instances capture closures and are not persisted by AnnotatedString.Saver. To define a reusable and saveable decoration, subclass DrawAnnotation instead.

Parameters

drawBehind optional callback run before painting the text glyphs
drawOver optional callback run after painting the text glyphs
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: