问题
A warning occours in eclipse when I tried to make a android table layout in xml this warning comes at table row of the layout part:
This TableRow view is useless (no children, no background, no id)
<TableRow android:layout_width="fill_parent" android:layout_height="wrap_content">
</TableRow>
Plese tell me how to overcome this warning.Thanks in advance.
回答1:
If you know that you use this TableRow
(e.g. you add children to it later in the code) just ignore the warning.
Upd: you can't use this TableRow
in code without id assigned to it. Why do you need the TableRow
?
回答2:
That situation appears when you have only one "RowTable" section.
Try to add second empty section, eg.
<TableRow android:id="@+id/tableRow2">
In my case it works.
回答3:
If you have single table layout then make Table layout parent remove any other parent tag.
You have similar problem try this Solution
来源:https://stackoverflow.com/questions/8848428/android-warning-this-tablerow-view-is-useless-no-children-no-background-no-i