one question ! How can i use my own imported svg ...
# compose
i
one question ! How can i use my own imported svg in a icon?
Copy code
Icon(
    imageVector = Icons.Default.PlayArrow,
    modifier = Modifier.padding(8.dp),
    contentDescription = null,
)
but i want the pause icon from the material icon without to import the whole lib ? how can i get a ImageVector from painterResource?
b
You can use
Icon
with a painterResource directly-
Copy code
Icon(
   painter = painterResource(R.drawable.ic_material_pause),
   modifier = Modifier.padding(8.dp),
   contentDescription = null
)
i
i know but
Copy code
imageVector = painterResource(id = R.drawable.pause),
intellj said found pointer
how can i make the pointer as ImageVector
s
Change
imageVector
to `painter`:
Copy code
painter = painterResource(id = R.drawable.pause),
👍 1
d
Copy code
painter = painterResource()
instead of
Copy code
imageVector = painterResource()
👍 2
i
oh man thx haha
what a stupid mistake haha