how can change the highlight color of a imageView inside gridview.
I've tried this,
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(width, height));
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
imageView.setBackgroundResource(R.drawable.menu_beh);
// imageView.setPadding(8, 8, 8, 8);
} else {
imageView = (ImageView) convertView;
}
String s=(String)HiveApp.mgd[position].posters[2].image.url;
// imageView.setImageDrawable(getPicture(items[position]));
HiveApp.id.download(s, imageView);
// id.DisplayImage(s, imageView);
return imageView;
}
I resolve it my self, you shoud add this to your layout xml
android:listSelector="@drawable/panel_picture_frame_background"
and not this
imageView.setBackgroundResource(R.color.gridview_highlight_selector);
thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With