1. HUGE Androidforums.com UPDATE! Learn what's new (and download the new app!)
    Dismiss Notice

android gallery item background

Last Updated:

  1. faisalloe

    faisalloe Member This Topic's Starter

    Jan 21, 2010
    Likes Received:
    I am using gallery widget
    adapter getview is some thing like following

    Code (Text):
    2. public View getView(int position, View convertView, ViewGroup parent) {
    3.             ImageView i = new ImageView(mContext);
    4.             i.setScaleType(ImageView.ScaleType.FIT_XY);
    5.             i.setLayoutParams(new Gallery.LayoutParams(42, 38));
    6.             CategoryRow catRow = getItem(position);
    7.             i.setImageResource(catRow.getUnSelectedImgSrc());
    8.             i.setTag(catRow);
    9.             return i;
    10.         }
    11. gallery.setSelection(adapter.getCount()/2, true);
    I have 2 images for every item one for normal one for selected and also will be used for center item in gallery.

    how can i use these two images for center or selected image and for normal image.

    when gallery displays center item is highlighted but when i start moving gallery center item not getting highlighted



Share This Page