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
android:layout_height="wrap_content"
cannot be used for subclasses of AdapterView
(e.g. ListView and GridView). The GridView would have to get each row's height in order to calculate its own height.
Remove the ScrollView
and the LinearLayout
, you don't need them. The GridView already has its own scrolling logic built-in.