Remove an Imageview

Asked

Viewed 229 times

2

Is there any way to remove an image in a Imageview or leave it empty via code?

For example: I "Seto"

img1.setImageResource(R.drawable.icon_circpreto);

It has how to remove it via code?

1 answer

2

You can do it like this

img1.setImageResource(android.R.color.transparent);

Another possible solution would be

img1.setImageDrawable(null);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.