如何在iPhone上的类似datagrid的表格中显示和输入大量数据
我正在开发一个基于iPhone的MIS,我需要制作一个表格来显示核心数据中的大量数据,编辑其中一些数据,然后保存它们。该表可能有数十列和数百行。
那么 iPhone 上的 ASP.NET 中是否有类似数据网格的东西呢?如果没有,如何在表中输入大量数据?
I am working on a iPhone based MIS, I need to make a table to show large amount of data from core data, edit some of them, then save them. The table could have tens of columns and hundreds of rows.
So it's there anything like the datagrid in ASP.NET on iPhone? If not, how can I input lots of data in a table?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我一直在寻找同样的东西并将其放在一起。它像 UITableView 一样重用行,并且可以绑定到各种数据源。我实现了两个数据源,一个用于静态数据,第二个允许您绑定到 NSFetchedResultsController。
我已经使用连接到 CoreData 存储的 NSFetchedResultsController 对其进行了测试,该存储在 iPhone 4S 上包含数十万行数据,并且性能非常好。还有扩展的空间,如果有这样的需求,我会继续开发和支持。
https://github.com/AlanSamet/ASDataGridView
I was looking for the same sort of thing and threw this together. It reuses rows like the UITableView and can be bound to a variety of data sources. I've implemented two datasources, one is for static data, and the second allows you to bind to an NSFetchedResultsController.
I have tested it with an NSFetchedResultsController connected to a CoreData store that contains hundreds of thousands of rows of data on the iPhone 4S and it performs very well. There is room for expansion and if there is any demand for this sort of thing, I will continue to develop and support it.
https://github.com/AlanSamet/ASDataGridView
这个 iOS 数据网格可能正是您所需要的 - 两者表格数据和滚动。它不是免费的,但看起来它提供的功能需要花费大量时间才能实现,因此您可能想检查一下。
This iOS data grid might be what you need - both tabular data and scrolling. It's not free, but looks like it provides functionality that would take significant time to implement so you might want to check it out.
另一种选择是使用 UIWebView。您要做的就是在代码中动态地为表创建 HTML。然后我使用 UIWebView 方法 loadHTMLString: baseURL: (注意:baseURL 可以为 nil)来加载生成的 HTML 字符串。
至于样式,我将 css 嵌入到 head 部分生成的 HTML 中,或者您也可以使用内联样式。
另外,请务必:
HIH
Another option is to use UIWebView. What you do is create the HTML for your table dynamically in your code. I then used the UIWebView method loadHTMLString: baseURL: (note: baseURL can be nil) to load my generated HTML string.
As for styling, I embedded the css in the HTML I generated in the head section or you can use inline styling.
Also, be sure to:
HIH
在我对此主题的研究中,我找到了一些链接:
https://github.com/AlanQuatermain/ AQGridView(免费)
http://ioscomponents.com/Home/Products(商业 - 很多功能 29 美元)
https:// www.developergarden.com/en/marketplace/components/details/cmp/ios-data-grid-table-view(商业版 129 美元)
http://www.binpress.com/app/vertical-horizontal-scrolling-datagrid-for-ios/1082 (商业的)
In my research on this topic, here are a few links that I have found:
https://github.com/AlanQuatermain/AQGridView (Free)
http://ioscomponents.com/Home/Products (Commercial - lots of features 29 USD)
https://www.developergarden.com/en/marketplace/components/details/cmp/ios-data-grid-table-view (commercial 129 USD)
http://www.binpress.com/app/vertical-horizontal-scrolling-datagrid-for-ios/1082 (Commercial)
因此,
UIScrollView
旨在显示任意宽度/高度的内容,而UITableView
提供了一个界面,通过它您可以显示任意长度的表格。UITableView
是UIScrollView
的子类。这是一个很好的起点 - 即使您最终不使用类本身并实现您自己的版本 - 因为它将向您展示查看回收的正确方法。没有用于显示“电子表格”的内置类,我认为这就是您所追求的。因此,您要么需要从头开始,要么看看是否可以破解/修改 UITableView 足以满足您的需求。您可能想查看一些现有的电子表格应用程序,以获取有关它们如何实现这一目标的提示/线索。很抱歉,iOS 中没有简单的方法可以完成您想要的操作,因此请做好准备!
So a
UIScrollView
is designed to display content of an arbitrary width/height, and aUITableView
provides an interface through which you can display a table of arbitrary length.UITableView
is a subclass ofUIScrollView
. It's a good starting point - even if you end up not using the class itself and implementating your own version - because it will show you the right approach to view recycling.There is no in-built class for displaying a 'spreadsheet', which I assume is what you're after. So you'll either need to roll your own from scratch, or see if you can hack/modify a UITableView enough to give you what you want. You may want to look at some of the existing spreadsheet apps for hints/clues as to how they've achieved it. I'm sorry to say there's no simple way within iOS to do what you're after, so be prepared for some work!