At the end it was the listSelector property on the GridView that was
producing the padding.
For future reference.

On Oct 16, 8:05 pm, Ivan <[email protected]> wrote:
> I think I tried everything on the attributes and can't find where that
> padding is coming from.
>
> Any ideas?
>
> On Oct 15, 10:15 pm, Ivan <[email protected]> wrote:
>
>
>
> > Hi, I'm doing the HelloViews Gridview tutorial and I ran into this
> > problem.
>
> >http://grab.by/9Vn
>
> > I have a padding that I can't find where is it coming from.
>
> > XML is the following:
> > <?xml version="1.0" encoding="utf-8"?>
> > <GridView xmlns:android="http://schemas.android.com/apk/res/android";
> >     android:id="@+id/gridview"
> >     android:layout_width="fill_parent"
> >     android:layout_height="fill_parent"
> >     android:numColumns="2"
> >     android:verticalSpacing="0px"
> >     android:horizontalSpacing="0px"
> >     android:stretchMode="columnWidth"
> >     android:gravity="center"
> >                 android:layout_margin="0dp"
> > />
>
> > and in my adapter:
>
> >             public View getView(int position, View convertView, ViewGroup
> > parent) {
> >                 ImageView imageView;
> >                 if (convertView == null) {  // if it's not recycled,
> > initialize some attributes
> >                     imageView = new ImageView(mContext);
> >                     imageView.setLayoutParams(new GridView.LayoutParams(160,
> > 160));
> >                     imageView.setPadding(0,0,0,0);
> >                     imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
>
> >                 } else {
> >                     imageView = (ImageView) convertView;
> >                 }
>
> >                 imageView.setImageResource(mThumbIds[position]);
> >                 return imageView;
> >             }
>
> > I can't seem to find the place where I can get rid of that padding (or
> > margin). Pictures are 160px x 160px.
>
> > Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to