如何在 Android 上制作 Facebook 的应用程序新菜单? [英] How to make Facebook's app new menu on Android?

查看:30
本文介绍了如何在 Android 上制作 Facebook 的应用程序新菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<块引用>

可能的重复:
还是其他类似 ViewPager?

谢谢!

编辑

它不可能是两者之一(ViewPagerSlidingDrawer).滑入的不是菜单,而是移开的主屏幕,只在屏幕上留下它的一小部分.就好像菜单已经在那个主屏幕后面,而它刚刚被发现.第二件事,我们实际上仍然可以与那个主屏幕进行交互(否则我会假设他们截取了屏幕截图的一小部分以构成该视图).

解决方案

我一直在寻找实现同样的事情,但我想出了一个足够好的解决方案(或者可能非常接近他们所做的).

>

所以我所做的是将两个布局堆叠在一起的单个 FrameLayout 然后我只是将顶部布局动画化以滑动到屏幕右侧(只需要调用 slideTo 或 scrollBy.基本上就是这样!相当简单有效!

我在这里用一些代码示例回答了一个类似的问题,享受 =):点击这里

Possible Duplicate:
Android facebook style slide

Recently Facebook released a new version of its Android application that features an improved navigation. One main new feature is the new menu (that already existed on the iOS version):

By clicking on the home button of the Action Bar, this menu slides from left to right, hiding the main activity that is no longer accessible.

How do you think this menu has been made? Do you think they have just played with the SlidingDrawer or is it something else like a ViewPager?

Thanks!

EDIT

There is no way that it could be one of the two (ViewPager or SlidingDrawer). It's not the menu that slides in, it's the main screen that moves away leaving only a tiny part of it on the screen. It's like if the menu was already behind that main screen and that it just got uncovered. And second thing, we can actually still interact with that main screen (otherwise I would have assumed that they took a screenshot in order to cut a tiny part of it to compose that view).

解决方案

I was looking for implementing the same thing and I came up with a solution that is good enough (or maybe is really near what they have done).

So what I did was a single FrameLayout with both of the Layouts stacked together and then I just animate the top layout to slide to the right of the screen (just need to call the slideTo or scrollBy. And basically it's that! Quite simple and effective!

EDIT:

I've answered to a similar question here with some code samples, enjoy =): Click here

这篇关于如何在 Android 上制作 Facebook 的应用程序新菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆