android gallery item background


Last Updated:

  1. faisalloe

    faisalloe Member This Topic's Starter

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

    Code (Text):
    1.  
    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

    [​IMG]
     

    Advertisement

Share This Page

Loading...