开发者

Android controls for navigation in a tree hierarchy

开发者 https://www.devze.com 2023-01-16 23:43 出处:网络
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

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
0

精彩评论

暂无评论...
验证码 换一张
取 消