有关在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 (或者使用带有某种分页控件的HorizontalScrollView,如果您期望宽表),或者仅使用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.
更多推荐
发布评论