本文介绍了Android的滑动项目横就像听歌应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是玩弄试图实​​现在听歌活动与水平的课程列表滑动功能等。链接此功能的屏幕截图。

I was playing around try to implement sliding functionality like in Duolingo Activity with horizontal lessons list. The link to screen capture of this functionality LINK.

使用水平滑块的滑动就没有这样的效果。这将是实现这种UX滑动部件的正确方法?

With horizontal slider the sliding has no such effects. What will be the proper way to implement such UX sliding widget?

我可以用costumize添加转场效果的默认的ListView?
或者,可能是它可能与CardView办呢?
做一些外部的lib提供这种如?

Could I costumize the default ListView with adding the transition effect?Or could be it possible to do it with CardView?Do some external lib offer this like twoway-view?

推荐答案

使用经典ViewPager展示内容,然后应用到寻呼机此PageTransformer:

Use classic ViewPager to show content and then apply to pager this PageTransformer:

   if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            mPager.setPageTransformer(false, new ViewPager.PageTransformer() {
                @Override
                public void transformPage(View page, float position) {
                    final float normalizedposition = Math.abs(Math.abs(position) - 1);
                    page.setScaleX(normalizedposition / 2 + 0.5f);
                    page.setScaleY(normalizedposition / 2 + 0.5f);
                }
            });
        }

这篇关于Android的滑动项目横就像听歌应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 04:27