Android - 在列表视图之间切换而不改变布局?

发布于 2024-10-01 09:30:22 字数 363 浏览 2 评论 0原文

我不是在这里寻找确切的代码,只是一个关于要寻找什么以及我应该阅读什么的方向,以便我可以弄清楚这一点。

我有一个布局,我想保持静态,只有列表视图根据从列表中选择的内容而变化。我已重新加载列表中的数据,但我希望选择之间有精美的过渡动画,并且希望应用程序在按回键时转到上一个菜单。

有人建议使用视图切换器,这看起来很棒,但我仍然不确定如何使用常规行布局填充布局中的列表视图,然后在选择时进行动画过渡到自定义行。另外,视图切换器似乎仅限于两个视图,因此当我想更深入地了解一些菜单时,这可能是一个限制。

最好,我想将每个菜单放在它自己的类中,以便我可以在该类中填充它,如果可能的话......

希望这不是太模糊,但如果是的话我会非常乐意进一步解释一下我自己。

I'm not looking for exact code here, just a direction on what to look for and what I should be reading about so I can figure this out.

I have a layout that I would like to remain static, with only the listview changing depending on what's selected from the list. I've reloaded data in the list, but I would like the fancy transition animations between choices, and would like the app to go to the previous menu when pressing back.

Someone suggested using a viewswitcher, which seems like it'd be great, but I am still unsure about how to fill a listview in a layout with a regular row layout, then on selection do an animated transition to a custom row. Also, it seems the viewswitcher is limited to two views, so it may be a limitation when I want to go a few menus deeper.

Preferably, I'd like to put each menu in it's own class so that I can handle filling it in that class, if possible...

Hope this isn't too vague, but if it is I'll be more than happy to explain myself further.

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

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

发布评论

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

评论(1

伴随着你 2024-10-08 09:30:22

不知道这是否是您的意思,但您是否尝试过显示和隐藏视图?

findViewById(R.id.listViewID).setVisibility(LinearLayout.GONE); //hide the one you want
findViewById(R.id.listViewID2).setVisibility(LinearLayout.VISIBLE); //show the one you want

希望这就是你的意思:)

Don't know if it's what you meant but have you tried showing and hiding the views?

findViewById(R.id.listViewID).setVisibility(LinearLayout.GONE); //hide the one you want
findViewById(R.id.listViewID2).setVisibility(LinearLayout.VISIBLE); //show the one you want

Hope it's what you meant :)

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