我正在设计一个水平寻呼机在Android Jetpack组成使用谷歌伴奏寻呼机(实现“com。谷歌伴奏:伴奏寻呼机:0.24.2-阿尔法”)。我实现这个水平寻呼机正确。但我想改变默认的动画寻呼机从水平左/右滑动淡入/淡出动画。我是新的组成,我没有找到任何有用的资源在互联网上。如果有人知道这一点,帮助我找到正确的解决方案。提前感谢。
val pagerState = rememberPagerState()
HorizontalPager(count = 3, state = pagerState
) { pagePosition ->
PagerScreen(onBoardingData = onBoardingDataList[pagePosition])
}
这里PagerScreen是每个屏幕的可组合函数。
Like this Gif I want fadein / fadeout for horizontal Pager
1条答案
按热度按时间izj3ouym1#
我不确定使用
HorizontalPager
是否有更好的解决方案,所以我使用swipeable
修饰符来实现这个解决方案。解决方案是评论,但为了更好地理解this article帮助了我很大。
结果如下:
您可以找到完整的源代码here。