android - DataGrid Android Studio 水平垂直滚动
问题描述
我正在寻找可以通过水平和垂直滚动显示大数据的解决方案。像这样的https://www.syncfusion.com/blogs/post/new-datagrid-for-xamarinios-and-xamarinandroid.aspx。我想更改列数并更改单元格值。
请问你有这样的吗?当它是免费的时候,我会很高兴。谢谢
解决方案
您可以通过自定义创建它TableLayout
。好消息是您可以在TableLayout
. 你必须先设置一个TableLayout
xml。对于两侧滚动,您必须先添加,ScrollView
然后HorizontalScrlollView
再添加TableLayout
.
现在您可以创建row和column。您可以动态创建它,因为您(可能)不知道需要多少列。因此,您必须创建自定义 TableRow 和单元格,并且您可以轻松地添加您的tableLayout
.
TableRow row= new TableRow(this);
TableRow.LayoutParams lp = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT);
row.setLayoutParams(lp);
// then create your text view and add it row. and last add row in your table layout
这只是一个例子。您可以创建自己的数据网格库
您可以使用一些现成的配合库在表格视图中显示数据网格,就像您的参考一样。:
https://github.com/evrencoskun/TableView https://github.com/ISchwarz23/SortableTableView
推荐阅读
- google-cloud-platform - 需要 GCP 虚拟机实例的启动和停止时间
- c# - 根据多个条件通过 linq 过滤集合
- postgresql - 如何在for循环中实现执行命令-postgres,dbeaver
- ios - 视频不在 AVPlayer 或 safari 中播放,但在 chrome 中播放
- python - (PythonCrashCourse) 外星人入侵高分
- xml-parsing - Liquibase“在xml changeLog文件中找不到元素'databaseChangeLog'的声明”
- node.js - 在 node.js 中将字符串转换为 64 位浮点数
- ios - 将 JSON 请求循环到后端(REST API)
- minizinc - 基于约束最大化
- google-cloud-platform - 在 GCP 中创建没有公共 IP 的虚拟机