I am loading gridview dynamically with buttons. So for that I am using scrollview, But if i assign wrap_content as height to gridview all the buttons are not displayed. I do
try this
int totalHeight = (count / ); if (count % != 0) { totalHeight++; } ViewGroup.LayoutParams params = gridview.getLayoutParams(); params.height = * totalHeight; gridview.setLayoutParams(params); gridview.requestLayout();