I have a vertical linear layout with two ListViews. I want the top ListView to take up 50% of the screen. I want the bottom listivew to take up 50% of the screen. How can I do this in XML?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The following layout should work
How this works:
wrap_content) is divided up between all the views with no height and alayout_weight(layout_weight of View) / (Sum of layout_weights in parent ViewGroup)(Sum of layout_weights in parent ViewGroup) = 2and(layout_weight of View) = 1for eachListView, so eachListViewoccupies1/2of the available space