0

我只是想使用 tableview 创建如下所示,但我不知道如何使它工作

 Sports (If it get touched it expands the subtopics) 
    Cricket (When it get Touched it push to next view controller)
    Football
    VolleyBall
 Bike (If it get touched it expands the subtopics)
    HeroHonda (When it get Touched it push to next view controller)
    Kawasaki
    Yamaha

主题和子主题的数量是已知的。

有可能像我期待的那样做吗?如果表格视图无法实现,那么另一种方法是什么?

任何帮助深表感谢。

4

2 回答 2

1

按照这个完美的解决方案您需要重新加载部分以展开和折叠子主题。

于 2012-12-06T18:33:44.253 回答
1

If you really need an expansion effect, I reccomend that you use some open-source solution such as VPPDropDown , or even MPFoldTransition.

The simpler solution would be to just use UITableViewSections for categories and cells for items, e.g.

Section 0 : Sports
  - Row 0 : Cricket
  - Row 1 : Football

Section 1 : Bike
  - Row 0 : Yamaha
  - Row 1 : Kawasaki 
于 2012-12-06T19:12:41.797 回答