简体   繁体   English

如何跨所有列显示视图?

[英]How to span a view across all columns?

In a TableLayout, is it possible to make a view span across all columns? 在TableLayout中,是否可以使视图跨所有列?

Setting layout_span to a large number (eg. 42) as in colspan in HTML doesn't seem to work. 像HTML的colspan一样,将layout_span设置为大量(例如42)似乎无效。 I also tried making the view the only view in the row and setting the layout_weight property to 1 and it still doesn't work. 我还尝试使该视图成为该行中的唯一视图,并将layout_weight属性设置为1,但仍然不起作用。

Any help will be greatly appreciated. 任何帮助将不胜感激。

Ok, i finally found a solution. 好的,我终于找到了解决方案。 Setting the stretchColumns attribute of the TableLayout element to "*" did the trick. 将TableLayout元素的stretchColumns属性设置为“ *”就可以了。 If you have more than one columns, you also need to set the layout_span property of the view to more than or equal to the maximum number of columns across all the rows. 如果您有多于一列,则还需要将视图的layout_span属性设置为大于或等于所有行中的最大列数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM