GridLayout Column width

前端 未结 3 2070
伪装坚强ぢ
伪装坚强ぢ 2021-02-11 12:56

I have 2 columns in my GridLayout. What I want to do is make those columns take up half of the width of the screen each and then have its child contents fill their

3条回答
  •  不思量自难忘°
    2021-02-11 13:26

    This code is available on pre API21 with support library!

    I have a simple piece of code to show 4 buttons in a gridLayout of 2 columns that take 50% of the available space: perhaps it can help

    
    
    
        

    Solution is perhaps this :

    android:layout_gravity="fill"
    android:layout_columnWeight="1"
    

提交回复
热议问题