1. Check out our app, Forums for Android! Download and leave feedback here!

android gallery item background

Discussion in 'Application Development' started by faisalloe, Apr 27, 2010.

  1. faisalloe

    faisalloe Member
    Thread Starter
    15

    Jan 21, 2010
    17
    0
    15
    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...