abhishek ameta
abhishek ameta

Reputation: 2416

Android warning "This TableRow view is useless (no children, no background, no id)"

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.

Upvotes: 2

Views: 8607

Answers (3)

nokian_ph
nokian_ph

Reputation: 61

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.

Upvotes: 6

Sergey Glotov
Sergey Glotov

Reputation: 20346

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?

Upvotes: 0

loks
loks

Reputation: 490

If you have single table layout then make Table layout parent remove any other parent tag.

You have similar problem try this Solution

Upvotes: 1

Related Questions