简体   繁体   English

如何在Monotouch中创建多个级别表?

[英]How to create multiple level tables in Monotouch?

I'm new in mono touch iOS/monotouch development. 我是Mono touch iOS / monotouch开发的新手。 I want to make multi-level table in my app, but don't know how.. i've tried to search web, but found nothing (except ancient 2009 year's sample which does not work). 我想在我的应用程序中创建多级表,但是不知道如何..我尝试搜索网络,但一无所获(除了2009年的古老示例无法正常工作)。

Let we have table: 让我们有表:

  • row1 第1行
  • row2 第2行
  • row3 第3行

User taps on row2 and it expands: 用户点击第2行,它将展开:

  • row1 第1行
  • row2 第2行
  • [subrow1] [subrow1]
  • [subrow2] [subrow2]
  • row3 第3行

If user tap row2 again, it collapses. 如果用户再次点击row2,它将折叠。

I know, realization should be quite easy, but I have no experience in it right now. 我知道,实现应该很容易,但是现在我还没有经验。 It will be great to get some assistance! 寻求帮助会很棒!

Thanks in advance. 提前致谢。

There is no built-in / default control in iOS that behaves like a TreeView (eg in System.Windows.Forms). iOS中没有行为类似于TreeView的内置/默认控件 (例如,在System.Windows.Forms中)。 This is largely because this requires a bit more screen space than an iPhone/iPod has. 这主要是因为与iPhone / iPod相比,这需要更多的屏幕空间。

The common solution is to use tables, eg add a ">" in your cell (which can be expanded) and show a new controller the data (either a table or something else). 常见的解决方案是使用表,例如在单元格中添加一个“>”(可以扩展),并向新控制器显示数据(表或其他内容)。

Another options is to find (and bind) some custom controls that offers a treeview-like controls (there are some listed in the previous link) or, like @Jason said, implement something similar out of an UITableView and related-types. 另一个选择是查找(并绑定)一些提供树状控件的自定义控件(在上一个链接中列出了一些控件),或者像@Jason所说的那样,从UITableView和相关类型中实现类似的功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM