Android two ListViews spacing and layout -


I have prepared the following layout where the UI has two linear layouts, everyone has a header text view and a list opinion. I need to set the altitude dynamically to list so that both of them appear properly.

It is like this:

layout

See how empty space is empty under the first list view, while another displays a scrollbar and can benefit that extra space?

Layout XML looks like this:

  & lt; LinearLayout xmlns: Android = "http://schemas.android.com/apk/res/android" Android: Layout_width = "fill_parent" Android: layout_height = "fill_parent" Android: orientation = "vertical" & gt; & Lt; LinearLayout Android: layout_width = "fill_parent" android: layout_height = "fill_parent" android: layout_weight = "1" Android: orientation = "vertical" & gt; & Lt; TextView android: Layout_height = "Wrap_content" Android: Layout_width = "Fill_parent" android: text = "cutting current" Android: paddingLeft = "3SP" android: background = "@ color / listHeader_Background" Android: Textcolor = "@ color / listHeader_Foreground "/> & Lt; ListView android: layout_width = "fill_parent" Android: layout_height = "wrap_content" android: layout_weight = "1" /> & Lt; / LinearLayout & gt; & Lt; LinearLayout Android: layout_width = "fill_parent" android: layout_height = "fill_parent" android: layout_weight = "1" Android: orientation = "vertical" & gt; & Lt; TextView android: Layout_height = "Wrap_content" Android: Layout_width = "Fill_parent" Android: paddingLeft = "3SP" Android: cut text = "solution" android: background = "@ color / listHeader_Background" Android: Textcolor = "@ color / listHeader_Foreground "/> & Lt; ListView android: layout_width = "fill_parent" Android: layout_height = "wrap_content" android: layout_weight = "1" /> & Lt; / LinearLayout & gt; & Lt; / LinearLayout & gt; In    

WRAP_CONTENT instead of FILL_PARENT heights of hair layout.

Comments