Showing fragment in ViewPager overlapped

烈酒焚心 提交于 2019-12-22 21:15:12

问题


I have an activity with 2 fragments, it uses a ViewPager and a FragmentPagerAdapter.

Now it shows only one fragment at a time, I would like to show the fragments a bit overlapped, like in this link.

Is it possible to do this without changing structure? In other words, without using MultiPaneLayout or something like that?

Thanks everyone


回答1:


Try this,It may clears ur problem

ViewPager examplePager = (ViewPager) findViewById(R.id.exampleView);
examplePager.setPageMargin(-50);
examplePager.setHorizontalFadingEdgeEnabled(true);
examplePager.setFadingEdgeLength(30);


来源:https://stackoverflow.com/questions/18719348/showing-fragment-in-viewpager-overlapped

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!