I want to navigate items in a tree hierarchy.
I put the items on the same level in a listview. Upon clicking the it开发者_如何学Goem in the listview it will open another listview to show the items in the child level.
I want the user to navigate easily to another level (parent, grandparent, grandgrandparent) without pressing the back buttons several times.
What is the best way (what type of Android controls) to handle this? Examples provided will be great.
I think you could use this
<LinearLayout>
<Spinner/>
<ListView/>
<LinearLayout>
Populate the Listview with all children of the current node. Populate the Spinner with Current node and all parent nodes. For the Spinner, I'd either show hierarchy through ordering, or by using pipe indenting as well.
So I the spinner would show:
Current
when closed
but when selected it would show
GrandParent
|Parent
||Current
精彩评论