问题
((ImageView) v.findViewById(R.id.imageViewHeart1)).setImageResource(R.drawable.heart);
I d like to remove my graphicss from my Image Resource so:
((ImageView) v.findViewById(R.id.imageViewHeart1)).setImageResource(null);
or something, how can I do this?
回答1:
If you remove image then used
((ImageView) v.findViewById(R.id.imageViewHeart1)).setImageResource(0);
回答2:
Use ImageView.setImageDrawable(null); or simply View.setVisibility(View.INVISIBLE);
回答3:
Try add transparent png with 1px width and 1px height.
来源:https://stackoverflow.com/questions/6015280/android-how-to-set-a-transparent-image-resource-of-a-view-or-remove-the-image