开发者

Android how to set a transparent image resource of a view? or Remove the image?

开发者 https://www.devze.com 2023-03-05 23:55 出处:网络
((ImageView) v.findViewById(R.id.imageViewHeart1)).setImageResource(R.drawable.heart); I d lik开发者_如何学运维e to remove my graphicss from my Image Resource so:
((ImageView) v.findViewById(R.id.imageViewHeart1)).setImageResource(R.drawable.heart);

I d lik开发者_如何学运维e to remove my graphicss from my Image Resource so:

((ImageView) v.findViewById(R.id.imageViewHeart1)).setImageResource(null);

or something, how can I do this?


If you remove image then used

((ImageView) v.findViewById(R.id.imageViewHeart1)).setImageResource(0);


Use ImageView.setImageDrawable(null); or simply View.setVisibility(View.INVISIBLE);


Try add transparent png with 1px width and 1px height.

0

精彩评论

暂无评论...
验证码 换一张
取 消