Layout problem: how to place something on top and bottom?

前端 未结 5 1619
忘掉有多难
忘掉有多难 2021-01-05 02:12

I want create a layout, with a horizontal LinearLayout(s) on top and bottom, a ListView fill in middle.

How can I define the main.xml.

I tried to create a la

5条回答
  •  [愿得一人]
    2021-01-05 03:15

    Here's what you're looking for. Estel's on the right track with the RelativeLayout (although it can be done with a LinearLayout, I think the RelativeLayout approach is cleaner, though) but the layout is out of order Nevermind, check Estel's comment which proved me wrong. :) You should first define your header, align it to the top; next, define your footer, and align it to the bottom; finally, declare your ListView, give it a height of fill_parent, and set it to layout above the footer and below the header:

     
    
        
        
    
        
        
    
        
    
    

提交回复
热议问题