Set style on TableRow in Android

前端 未结 3 1444
我在风中等你
我在风中等你 2020-12-19 01:54

Using the Android SDK, there doesn\'t seem to be any way to set the style on a table row. I want to do the equivalent of:



        
3条回答
  •  轮回少年
    2020-12-19 02:28

    The best solution I've found to accomplish this is to create a "partial" layout representing the table row, with a style defined:

    
    
    

    Then inflate it in your code, to use dynamically:

    TableRow tr = (TableRow) getLayoutInflater().inflate(R.layout.partial_table_row, null);
    

    While not ideal, it does work for me

提交回复
热议问题