用于在树层次结构中导航的 Android 控件

发布于 2024-09-24 17:38:19 字数 186 浏览 0 评论 0原文

我想在树层次结构中导航项目。

我将这些项目放在列表视图中的同一级别上。单击列表视图中的项目后,它将打开另一个列表视图以显示子级别中的项目。

我希望用户能够轻松导航到另一个级别(父母、祖父母、曾祖父母),而无需多次按后退按钮。

处理这个问题的最佳方法是什么(什么类型的 Android 控件)?提供的例子会很棒。

I want to navigate items in a tree hierarchy.

I put the items on the same level in a listview. Upon clicking the item 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

溺渁∝ 2024-10-01 17:38:19

我认为您可以使用此

<LinearLayout>
   <Spinner/>
   <ListView/>
<LinearLayout>

填充列表视图与当前节点的所有子节点。
使用当前节点和所有父节点填充微调器。
对于 Spinner,我要么通过排序来显示层次结构,要么也通过使用管道缩进来显示层次结构。

所以我旋转器会显示:
关闭时的当前
但选择后会显示

GrandParent
|Parent
||Current

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文