maurycyw / StaggeredGridView

A modified version of Android's experimental StaggeredGridView. Includes own OnItemClickListener and OnItemLongClickListener, selector, and fixed position restore.
https://github.com/maurycyw/StaggeredGridViewDemo
1.64k stars 664 forks source link

UI gets messy when scrolled up #83

Open poojagaonkar opened 10 years ago

poojagaonkar commented 10 years ago

Hi,

When I scroll the app down and again up the UI gets messy . r

If I change a line in the activity to:-

convertView.setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, 400));

This problem goes away but the images are displayed in a normal gridview pattern

yubaojian02 commented 10 years ago

is it solved?

poojagaonkar commented 10 years ago

@yubaojian02 no its not solved

vicianm commented 10 years ago

Solution for this problem: https://github.com/maurycyw/StaggeredGridView/issues/89

The problem is, that there are some variables cached in onMeasure() method. You need to comment "if" statements so that onMeasure() always recalculates necessary atributes.