在Android平台上显示表格(Displaying a table on the Android platform)

编程入门 行业动态 更新时间:2024-10-26 09:24:50
在Android平台上显示表格(Displaying a table on the Android platform)

有关在Android平台上显示此表的最佳方式的任何建议? 格式不是必需的,但我正在寻找一种灵活的方式来做到这一点,因为有许多表的行数和列数不同。

Any suggestions on the best way to display this table on an Android platform? The formatting is not necessary but I am looking for a flexible way to do this because there are numerous tables with different numbers of rows and columns.

最满意答案

我要么使用包装在ScrollView中的TableLayout (或者使用带有某种分页控件的Horizo​​ntalScrollView,如果您期望宽表),或者仅使用HTML编码您的表并使用WebView 。 就灵活性/可重用性而言,您可能需要考虑子类化TableLayout以提供用于使用不同选项实例化表的快捷方式,或者让您在自动绑定行为时将其放在XML中; 例如,请参阅本SO贴子的第二个答案。

I'd either use a TableLayout wrapped in a ScrollView (or a HorizontalScrollView with a paging control of some sort, if you expect wide tables) or just code your table in HTML and use a WebView. As far as flexibility/reusability, you may want to consider subclassing TableLayout to provide shortcuts for instantiating the table with different options or to let you lay it out in XML while binding behaviors automatically; see the 2nd answer to this SO post for an example.

更多推荐

本文发布于:2023-08-06 16:42:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1453880.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表格   平台上   Android   platform   table

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!