Composable Function

vectorResource

Load an ImageVector from a vector resource.

vectorResource

Source set: Android
@Composable
public fun ImageVector.Companion.vectorResource(@DrawableRes id: Int): ImageVector

Load an ImageVector from a vector resource.

This function is intended to be used for when low-level ImageVector-specific functionality is required. For simply displaying onscreen, the vector/bitmap-agnostic painterResource is recommended instead.

Parameters

id the resource identifier

Return

the vector data associated with the resource

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: