Android UI:如何在维护其余部分的同时更换屏幕的一部分

发布于 2024-10-28 04:04:08 字数 338 浏览 0 评论 0 原文

我正在尝试实现聊天窗口上 android google talk 应用程序的一部分的效果。 效果是有一个静态的顶部和底部,但您可以在各个打开的聊天之间滑动。

换句话说,我正在尝试设计一个屏幕,其中顶部和底部有一个静态部分,中间有一个动态部分,想想一个图库应用程序,它在顶部显示标题,“显示下一个”底部的“图像”按钮和中心的图片被替换为在活动之间切换时看到的相同过渡,唯一的区别是,我需要在中心替换更复杂的布局,而不是图像(几个文本视图和一个图像)

我应该如何去做呢? 我考虑过动画,但它似乎太复杂了,我考虑了片段,但我不知道它是否在所有版本上都支持,我还考虑过使用充气机在运行时进行绘制,但这不允许我进行“下一个活动” “ 影响。

I'm trying to achieve the effect that is part of the android google talk application on the chat window.
The effect is that there is a static top and bottom, but you can swipe between the various open chats that you have.

in other words, I'm trying to design a screen where there's a static section on top and on the bottom and a dynamic part in the center, think of a gallery app, where it shows you the title on top, a "show next image" button on the bottom and a picture in the center that gets replaced with the same transition you would see when switching between activities, only difference is that instead of an image, I need a more complex layout to be replaced in the center (a couple of text views and an image)

How should I go about doing that?
I thought about animations but it seems too complicated, and I thought about fragments but i don't know if it's supported on all versions or not and I also thought of drawing in runtime using the inflater but that doesnt let me do the "next activity" effect.

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

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

发布评论

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

评论(3

你げ笑在眉眼 2024-11-04 04:04:08

您可以使用RelativeLayout,并将页眉视图与顶部对齐,页脚视图与底部对齐,中间的图库视图(或包含将要更改的视图的某些布局)位于页脚视图上方,在标题视图下方。

You could use a RelativeLayout and have your header view aligned to the top of it, your footer view aligned to the bottom, and a middle Gallery view (or some layout that contains the views that will be changed) that is above the footer view and below the header view.

天涯沦落人 2024-11-04 04:04:08

如果您对动画不感兴趣,您可以将所有布局放在屏幕中并使用 View.GONE/View.VISIBLE/View.INVISIBLE 标志进行播放。使用标签进行更好的编码。

IF you're not interested in the animations, you can just put all of your layouts in the screen and play with View.GONE/View.VISIBLE/View.INVISIBLE flags. use the tag for nicer coding.

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