Android TableLayout Width

后端 未结 6 745
耶瑟儿~
耶瑟儿~ 2021-01-30 21:33

I have a two column TableLayout as the only child of a scroll view. The first column contains TextViews (\'labels\') and the second column contains

6条回答
  •  花落未央
    2021-01-30 22:24

    The pragmatic way to solve this is to use the stretchColumns and shrinkColumns attributes in TableLayout. Their values should be 0-based indexes of columns.

    For example, if you have a two column Table layout and:

    • You would like the second column to fill up with empty space (stretch) so the TableLayout fits the entire parent view on a large screen device
    • You would like the first column to be shrunk (and its contents possibly wrapped / ellipsized) on a small screen device

    you would define your TableLayout as:

    
    
    

提交回复
热议问题