Button moving out of view - android
===

I have a vertical linear layout with 3 buttons vertically aligned one below the other. In between each button, i have set a linear layout whose visibility is GONE initially. When the 1st button is clicked, the linear layout beneath it is changed to visible and the list view which i have defined in that layout comes in view while the remaining 2 buttons remain attached to the linear layout. 

The problem is that if the list view within the linear layout (which i have added using java code) is too big, then the 2 buttons below the 1st one go out of view. What remains is the layout beneath the 1st button. 

I want the 2 buttons to be bound to the view. Any help will be appreciated. Thanks.  