Android的Facebook的样式滑盖 [英] Android Facebook style slide

查看:93
本文介绍了Android的Facebook的样式滑盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新的Facebook应用程序和它的导航是太酷了。我只是想看看它是如何能在我的应用程序来模拟。

The new Facebook application and its navigation is so cool. I was just trying to see how it can be emulated in my application.

任何人有一个线索,如何才能实现?

Anyone has a clue how it can be achieved?

在点击左上角的按钮,页面滑动和下面的屏幕显示:

On clicking the the top left button the page slide and the following screen is shown:

的YouTube视频

推荐答案

我有玩这个我自己,我能找到的最好的方法是使用一个的FrameLayout,并在上面打下一个自定义Horizo​​ntalScrollView(HSV)菜单。里面的HSV是你的应用程序视图的的有一个透明的视图作为第一个孩子。这意味着,当HSV已经为零滚动偏移量,菜单将通过展示(仍然可以点击奇怪)。

I've had a play with this myself, and the best way I could find was to use a FrameLayout and lay a custom HorizontalScrollView (HSV) on top of the menu. Inside the HSV are your application Views, but there is a transparent View as the first child. This means, when the HSV has zero scroll offset, the menu will show through (and still be clickable surprisingly).

在应用程序启动时,我们滚动HSV的第一个可见的应用程序视图的失调,而当我们要显示我们向后滚动以显示菜单通过透明的视图菜单。

When the app starts up, we scroll the HSV to the offset of the first visible application View, and when we want to show the menu we scroll back to reveal the menu through the transparent View.

在code是在这里,而底部的两个按钮(称为HorzScrollWithListMenu和HorzScrollWithImageMenu)在启动活动展示我能想出的最好的菜单:

The code is here, and the bottom two buttons (called HorzScrollWithListMenu and HorzScrollWithImageMenu) in the Launch activity show the best menus I could come up with:

Android的滑动菜单演示

从模拟器截图(中卷):

Screenshot from emulator (mid-scroll):

截图来自设备(全卷)。请注意我的图标不一样宽Facebook的菜单图标,所以菜单视图和应用程序视图不对齐。

Screenshot from device (full-scroll). Note my icon is not as wide as the Facebook menu icon, so the menu view and 'app' view are not aligned.

这篇关于Android的Facebook的样式滑盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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