FragmentPagerAdapter刷卡显示的ListView 1/3屏幕宽度 [英] FragmentPagerAdapter Swipe to show ListView 1/3 Screen Width

查看:176
本文介绍了FragmentPagerAdapter刷卡显示的ListView 1/3屏幕宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑: 见我的回答如下 - >

我希望有一种观点认为,当刷卡到右侧,列表视图显示。非常类似于在新的谷歌实施Play商店(下面的示例图像)。我认为它是一个ViewPager但我想复制它没有prevail。我想这可能只是对ListView的页面'width属性被设置为一个特定的DP,但不起作用。我也尝试修改 pakerfeldt的viewFlow 并不能搞清楚谷歌是如何做到这一点

I am wanting to have a view that when swiped to the right, the listView is shown. Very much similar to what is implemented in the new Google Play Store (Sample image below). I think its a ViewPager but I tried duplicating it without prevail. I was thinking it may just be that the 'listView Page' width attribute was set to a specific dp but that doesn't work. I also tried modifying pakerfeldt's viewFlow and cant figure out how Google does this

我是在正确的轨道?如果有人有一个想法如何复制这一点,我将不胜AP preciate它。我想,这可能会成为显示在平板电脑导航视图的流行的新方法....? code是最好的帮助。谢谢!!

Am I on the right track? If someone has an idea how to duplicate this, I would greatly appreciate it. I think this may become a popular new way of showing a navigation view on tablets....? Code would be best of help. Thank you!!

向右滑动:

Finnished刷卡;布局显示列表和部分的第二段片段(严格按照图示)清单片段不填充屏幕:

Finnished swipe; the layout shows the list and PART OF THE SECOND FRAGMENT (EXACTLY AS SHOWN) The list fragment does not fill the screen:

当离开用户挥笔,主页只显示,如果用户再次挥笔留下的viewPager继续到下一个页面。

When the user swipes left, the main page is only shown and if the user swipes left again the viewPager continues to the next page.

推荐答案

抱歉这么晚才更新。我实现了这从walkingice上Gethub 用很少的修改。只需使用一个条件语句的GestureDetector刷卡它眼帘只有当'0'ViewPager id的视图。我还添加了一个切换whithin我的动作条

Sorry for the late update. I implemented this from walkingice on Gethub with very little modification. Just use a conditional statement for a GestureDetector to swipe it into view only when a ViewPager id of '0' is in view. I also added a toggle whithin my ActionBar

这篇关于FragmentPagerAdapter刷卡显示的ListView 1/3屏幕宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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