i want to create a tablelayout within the code.
Every n-th row should be a Headline with only one textview. The other rows should contain 3 textviews. All first, second and third views should be the same width of course.
my problem now is that the width of the first column is set by the broadest texview which is the headline, but that’s way to big for the first views of the other rows. so i would like to combine the cells of the row, where the headline is located, so it can span over the whole row. and the other cells should be the size of the broadest text.
this is how it should look
______________________________
|Long Title__________________|
|x___|YYYY_____|ZZZ__________|
|XXX_|YYYYYYYYY|ZZZZ_________|
|xxxx|YYYYY____|ZZZ__________|
|xxx_|YY_______|Z____________|
|Long Title__________________|
|x___|YYYY_____|ZZZ__________|
|XXX_|YYYYYYYYY|ZZZZ_________|
|xxxx|YYYYY____|ZZZ__________|
|xxx_|YY_______|Z____________|
this is how it looks atm
______________________________
|Long Title__________________|
|x_________|YYYY_____|ZZZ____|
|XXX_______|YYYYYYYYY|ZZZZ___|
|xxxx______|YYYYY____|ZZZ____|
|xxx_______|YY_______|Z______|
|Long Title__________________|
|x_________|YYYY_____|ZZZ____|
|XXX_______|YYYYYYYYY|ZZZZ___|
|xxxx______|YYYYY____|ZZZ____|
|xxx_______|YY_______|Z______|
would be great if someone can help me.
the following code can help. Just add another Linear Layout block to have 3 rows.
Use the following links for more reference on aligning. Once you add the 3rd Linear Layout block , with weight 1, it will align perfectly.
http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html
http://developer.android.com/reference/android/widget/LinearLayout.LayoutParams.html
Repeating the same, you can get another 3 block row.
Please see the edit. you can use something like this