Created
April 29, 2015 03:58
-
-
Save layerlre/cd283f0e9ac90ea54709 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void seteGridviewHeight(GridView gridView, float itemCount,float numColumn) { | |
int row = (int) Math.ceil((itemCount + 1f) / numColumn); | |
Log.d("debug", "-------row = " + row); | |
int height = (imageHeight * row); // imageHeight = ความสูงของแต่ละแถวหรือความสูงของรูป | |
height += (row - 1) * verticalSpacing; | |
gridView.getLayoutParams().height = height; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment