Reputation: 253
I am using Dev05(which just released).
In the documentation the icon looks like this icon: Image,
but in Android Studio
the icon is of type Painter(which was added in Dev05) icon: Painter,
.
How would I convert an image to this new Painter type? Or am I missing something completely?
Upvotes: 2
Views: 407
Reputation: 363439
With 1.0.0-beta02
you can use:
val image = Image(painterResource(id = R.drawable.xxx),"contentDescription")
Upvotes: 0
Reputation: 850
Use ImagePainter()
and pass in the image
.
something like this,
val image = ImagePainter(imageResource(R.drawable.YOUR-IMAGE))
AppBarIcon(image, onClick = {
//Do something
})
Upvotes: 2