简体   繁体   中英

How to create multiple level tables in Monotouch?

I'm new in mono touch iOS/monotouch development. 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).

Let we have table:

  • row1
  • row2
  • row3

User taps on row2 and it expands:

  • row1
  • row2
  • [subrow1]
  • [subrow2]
  • row3

If user tap row2 again, it collapses.

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). This is largely because this requires a bit more screen space than an iPhone/iPod has.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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