How to clear or hide an ImageView in Android

// solution 1
ImageView imageView = (ImageView)findViewById(R.id.myimage);
imageView.setImageDrawable(null);
// or
imageView.setImageResource(0);
 
// solution 2  hide ImageView
imageView.setVisibility(View.INVISIBLE);
 
// solution 3 resize ImageView 0, 0
 hImageViewSemafor.setLayoutParams(new LinearLayout.LayoutParams(0,0));
This entry was posted in Android Examples Code, Bitmap, drawing and tagged , . Bookmark the permalink.


Comments are closed.



10,801 views