Dany Y
Dany Y

Reputation: 7031

is it possible to add a webview inside tableRow in android?

I want to have a list of WebViews inside a TableLayout, but its not working.

I guess the problem is because the TableRow always takes the height of the wrapped contents. and the WebView has a height of zero before it is loaded.

it is mentionned in the TableLayout documentation

The children of a TableLayout cannot specify the layout_width attribute. Width is always MATCH_PARENT. However, the layout_height attribute can be defined by a child; default value is WRAP_CONTENT. If the child is a TableRow, then the height is always WRAP_CONTENT.

Is there a workaround for this? Is there an application where it is done, just to know if such a thing is possible ?

Thank you

Upvotes: 0

Views: 439

Answers (1)

inazaruk
inazaruk

Reputation: 74790

Just set the minHeight and minWidth to some reasonable values. These values can be either calculated at run-time when activity/fragment is being created, or may be specified in resources so value can be different for different device form-factors.

Upvotes: 0

Related Questions