在Gallery控件中插入了若干张图片,运行时发现每两张图片间都有一部分重叠,Gallery的Adapter中getView的实现方法如下,请问如何解决,谢谢
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
ImageView imgView=new ImageView(m_Context);

imgView.setImageResource(m_iImgIds[position]);

imgView.setScaleType(ImageView.ScaleType.FIT_CENTER);

imgView.setLayoutParams(new Gallery.LayoutParams(60,90));

imgView.setAlpha(200);



return imgView;
}

解决方案 »

  1.   

    imgView.setLayoutParams(new Gallery.LayoutParams(60,90));你设置这个的目的何在?这个好像是设置imageview的位置的吧。
      

  2.   

    在layout里面有个:定义gallery的 padding属性
      

  3.   

    在Gallery里加上
     android:spacing="2dip"
    试试
      

  4.   

    加上spacing后,gallery滑动图片时会来回晃(回弹)。请问去除图片叠加还有别的方法吗???