ViewPager animation fade in/out instead of slide(ViewPager 动画淡入/淡出而不是幻灯片)
问题描述
我从这里获得了 FragmentBasics 示例.有没有办法让 ViewPager 动画在我滑动而不是左右滑动时简单地淡入和淡出?我一直在用 PageTransformer 尝试一些东西,但没有成功,我仍然可以看到它在滑动.所以我想我需要以某种方式强制它的位置保持不变,而滑动手指只会影响 alpha.
I got the FragmentBasics example from here. Is there a way make the ViewPager animation simply fade in and out when I swipe instead of sliding left and right? I've been trying some stuff with PageTransformer, but no success, I can still see it sliding. So I guess I need to somehow force its position to stay put, while sliding my finger only affects the alpha.
推荐答案
这应该更适合淡入/淡出转换:
This should work better for the fade in/out transform:
这篇关于ViewPager 动画淡入/淡出而不是幻灯片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!