Android75
04/13/2022, 6:11 AMjava.lang.IllegalArgumentException: Only VectorDrawables and rasterized asset types are supported ex. PNG, JPG
this is shape.
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="<http://schemas.android.com/apk/res/android>" android:shape="oval">
<solid android:color="#F44336"/>
</shape>
and code.
Image(
imageVector = ImageVector.vectorResource(
id = R.drawable.ball
),
contentDescription = null
)
painter = painterResource(id = R.drawable.ball),
var img= ContextCompat.getDrawable(LocalContext.current, R.drawable.ball)?.toBitmap()?.asImageBitmap()
img?.let {
Image(bitmap = img,
Albert Chang
04/13/2022, 6:32 AMModifier.shape()
(or Modifier.background()
) in compose and is definitely better that way.Android75
04/13/2022, 6:44 AMChris Sinco [G]
04/13/2022, 10:02 AM