Android:ImageView 设置图片

ImageView iv; 

String fileName = "/data/data/com.test/aa.png; 
Bitmap bm = BitmapFactory.decodeFile(fileName); 
iv.setImageBitmap(bm); 


ImageView iv = new ImageView(context); 
iv.setImageResource(iv[position]); 
iv.setScaleType(ImageView.ScaleType.FIT_XY); 
iv.setLayoutParams(new Gallery.LayoutParams(136,88)); 


mImageView = (ImageView)this.findViewById(R.id.myImageView1); 
mImageView.setImageDrawable(getResources().getDrawable(R.drawable.right)

你可能感兴趣的:(android,imageview)