Skip to content Skip to sidebar Skip to footer

Linearlayout Doesn't Show All Childs

I have problem in this layout that : it doesn't show any child after the listView and the listview is filling this sight ; it scrolls but didn't show the any other child I have tri

Solution 1:

When you are using ListView in the layout you have to add this property android:layout_weight for the listview. Without this property being set, you cannot get all views.

Solution 2:

Since your layout is linear any views that exceeds the limit of the screen are not displayed in the screen. Yes scrollview makes issues with list or expandable listview as the scrollview itself is scrollable it will consume the scrolls of listview and expandablelist. To resolve this you have to re order or change your layouts to make your rest of the views visible

Solution 3:

Give the first ListView some constant height. Like

<ListView
android:id="@+id/listView"android:layout_width="match_parent"android:layout_height="300dip"
....
/>

LinearLayout will not scroll when its content increases. And you cannot use a ScrollView as parent for ListView.

Solution 4:

Set all layout_height - attributes from direct childs of your root layout to fill_parent. Than give every of these layouts a attribute layout_weight. The value of layout_weight is an integer according to how many space they've been granted in the view. For example two views: one with weight 2 and one with weight 1: The weight 1 is twice the size of weight 2. Just play a little with the weight attribute to find out for yourself.

Solution 5:

You have given height of listview as wrap_content so it will occupy the all the space in screen so u give the height of listview fixed and same thing applied to expandable list also give fix height to that also.

Hope u get it All The best

Post a Comment for "Linearlayout Doesn't Show All Childs"