DataGrid Android Studio水平垂直滚动

时间:2019-09-02 07:02:09

标签: android android-studio datagrid

我正在寻找可以通过水平和垂直滚动消除大数据的解决方案。像这样的https://www.syncfusion.com/blogs/post/new-datagrid-for-xamarinios-and-xamarinandroid.aspx。我想更改列数并更改单元格值。

请问您有这样的要求吗?当它是免费的时候,我会很高兴。谢谢

1 个答案:

答案 0 :(得分:0)

您可以通过自定义import xlrd file_location = "C:\\Users\\somename\\Desktop\\Scripts\\credit_scroll.xls" workbook = xlrd.open_workbook(file_location) sheet = workbook.sheet_by_index(0) #Find starting point for each section for row in range(sheet.nrows): for col in range(sheet.ncols): if sheet.cell_value(row, col) == 'cast': castvar = (row) print(castvar) for row in range(sheet.nrows): for col in range(sheet.ncols): if sheet.cell_value(row, col) == 'crew': crewvar = (row) print(crewvar) for row in range(sheet.nrows): for col in range(sheet.ncols): if sheet.cell_value(row, col) == 'post': postvar = (row) print(postvar) for row in range(sheet.nrows): for col in range(sheet.ncols): if sheet.cell_value(row, col) == 'special': specialvar = (row) print(specialvar) #save each range of names to variables def get_cell_range(start_col, start_row, end_col, end_row): return [sheet.row_slice(row, start_colx=start_col, end_colx=end_col+1) for row in range(start_row, end_row+1)] data = get_cell_range(1, castvar, 1, crewvar) print(data) my_var = ''.join(str(x) for x in data) print("saving") print(my_var) 创建它。好消息是您可以在TableLayout中添加双向滚动机制。您必须首先设置一个TableLayout xml。对于双向滚动,您必须先添加TableLayout,然后添加ScrollView,然后再添加HorizontalScrlollView

现在,您可以创建。您可以动态创建它,因为您(可能)不知道需要多少列。因此,您必须创建自定义TableRow和单元格,并且可以轻松添加TableLayout

tableLayout

这只是示例。您可以创建自己的数据网格库

您可以准备一些配合库以在表格视图中显示数据网格,例如您的参考。 :

https://github.com/evrencoskun/TableView https://github.com/ISchwarz23/SortableTableView

相关问题