Android : ViewFlipper Or ViewPager - Which is the better option?

前端 未结 1 1986
庸人自扰
庸人自扰 2020-12-09 08:46

I am getting stuck in one stage. I have a total of 20 to 25 images that should get animated like ViewPager does. Now on all the images I have onClick()

相关标签:
1条回答
  • 2020-12-09 09:18

    intro: On first thought I would recommend Gallery widget instead of ViewFlipper but it is depreciated (0.o) since JellyBean (API 16), probably because of bad recycling of nonvisible elements implementation.

    answer: What u really should use now is ViewPager or HorizontalScrollView. In your case (despite not too much given details) I think is better ViewPager because according to documentation:

    .. HorizontalScrollView is a FrameLayout, meaning you should place one child in it, containing the entire contents to scroll ..

    On the other side for ViewPager you should implement PagerAdapter to generate pages which will be shown in this view.

    My final answer is A, ViewPager ;)

    Hope u will find this helpful ;) Cheers

    0 讨论(0)
提交回复
热议问题