layout_weight with buttons and text views in table row

后端 未结 1 1679
一个人的身影
一个人的身影 2021-01-16 10:59

I am trying to make four rows of three buttons each, and at the bottom of the buttons are two text views. I would like for them all to be spaced evenly but they aren\'t and

1条回答
  •  别那么骄傲
    2021-01-16 11:30

    Ok so to help out with this add android:stretchColumns="0,1,2,3" in your Table Layout which would make buttons even sized.

    Secondly add a android:layout_span="2" to both of your text views.

    Heres you a final code:

    
    
    .
    .
    .
    
    .
    .
    
    
    
    
    

    If you are setting the text size programmatically to make your TextViews evenly spaced, its not needed when you have android:layout_span set.

    0 讨论(0)
提交回复
热议问题