gallery每屏仅显示一幅图片

 

  1.    public View getView(int position, View convertView, ViewGroup parent) {  
  2.         ImageView imageView = new ImageView(context);  
  3.         Bitmap bitmap = this.images.get(position);  
  4.         imageView.setImageBitmap(bitmap);  
  5.         //设置样式 :填充整个屏幕  
  6.         imageView.setLayoutParams(new Gallery.LayoutParams(Gallery.LayoutParams.FILL_PARENT,  
  7.                 Gallery.LayoutParams.FILL_PARENT));  
  8.         //设置缩放比例:保持原样  
  9.         imageView.setScaleType(ImageView.ScaleType.CENTER);   
  10.         return imageView;  
  11.     }  

你可能感兴趣的:(图片,gallery)