¡@

Home 

2014/10/16 ¤W¤È 08:19:30

android Programming Glossary: mmaxrowheight

GridView rows overlapping: how to make row height fit the tallest item?

http://stackoverflow.com/questions/7545915/gridview-rows-overlapping-how-to-make-row-height-fit-the-tallest-item

Colburn public class GridViewItemLayout extends LinearLayout Array of max cell heights for each row private static int mMaxRowHeight The number of columns in the grid view private static int mNumColumns The position of the view cell private int mPosition.. numColumns @param itemCount public static void initItemLayout int numColumns int itemCount mNumColumns numColumns mMaxRowHeight new int itemCount @Override protected void onMeasure int widthMeasureSpec int heightMeasureSpec super.onMeasure widthMeasureSpec.. widthMeasureSpec heightMeasureSpec Do not calculate max height if column count is only one if mNumColumns 1 mMaxRowHeight null return Get the current view cell index for the grid row int rowIndex mPosition mNumColumns Get the measured height..