安卓:ViewFlipper或者ViewPager - 哪一个是更好的选择? [英] Android : ViewFlipper Or ViewPager - Which is the better option?

查看:305
本文介绍了安卓:ViewFlipper或者ViewPager - 哪一个是更好的选择?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被陷在一个阶段。我总觉得应该得到像动画片 ViewPager 20至25的图像一样。现在,在所有影像上我有的onClick()事件,我不知道我是否应该用 ViewPager 工作或 ViewFlipper 。我可以同时实现的事情,在这里没有问题。

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() events and I don't know if I should work with ViewPager or ViewFlipper. I can implement both things, no issues here.

我想要什么:我只想一个建议,根据我的问题,这将是最好的选择, ViewFlipper ViewPager

What I Want : I just want a suggestion that according to my problem which will be the best option, ViewFlipper or ViewPager?

我寻觅什么:我通过计算器,即<不同的环节不见了href=\"http://stackoverflow.com/questions/7338351/how-to-improve-the-performance-of-viewflipper-viewanimator\">How改善ViewFlipper / ViewAnimator 和 ViewFlipper VS片段的表现,但我找不到我想要的东西。

What I Have Searched : I have gone through different links on StackOverflow, namely How to improve the performance of ViewFlipper/ViewAnimator and ViewFlipper vs Fragments, but I could not find the thing I want.

我与 ViewPager 工作有点,但当时有只有3或4 片段我不得不管理。如果我是用它来解决这个问题,我必须要管理25 片段这个时候。所以,我想知道是否有可用一个更好的解决方案。

I have worked with ViewPager somewhat, but at that time there were just 3 or 4 Fragments I had to manage. If I were to use it to solve this problem I have to manage 25 Fragments this time. So I am wondering if there is a better solution available.

我也做了一些R&放大器; D于 ViewFliper ,并且知道它只有一个活动我要管理,但它不具备的动画准确性 ViewPager 了。

I have also done a little R & D on ViewFliper and know that it has only one Activity I have to manage but it does not have the animation accuracy that ViewPager has.

请提示我是否应该去 ViewPager ViewFlipper

Please suggest me whether I should go for ViewPager or ViewFlipper?

先谢谢了。

推荐答案

介绍:的在第一个想到我会推荐的图库的小部件,而不是的 ViewFlipper 但因为软糖(API 16)pciated(0.o)德$ p $,可能是因为不可见元素实现不良循环利用。

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.

答:的什么ü真正应该现在用的就是<一个href=\"http://developer.android.com/reference/android/support/v4/view/ViewPager.html\">ViewPager或<一个href=\"http://developer.android.com/reference/android/widget/HorizontalScrollView.html\">HorizontalScrollView.在你的情况(尽管没有太多细节给)我认为是更好的 ViewPager 因为根据文档:

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:

.. <一href=\"http://developer.android.com/reference/android/widget/HorizontalScrollView.html\">HorizontalScrollView是的FrameLayout,这意味着你应该将一个
  孩子呢,包含的全部内容进行滚动..

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

在另一边 ViewPager 你应该实施<一个href=\"http://developer.android.com/reference/android/support/v4/view/PagerAdapter.html\">PagerAdapter以产生将在此视图中显示被页面。

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

我最后的答案是的 A 的, ViewPager ;)

My final answer is A, ViewPager ;)

希望你会发现这是很有帮助的;)干杯

Hope u will find this helpful ;) Cheers

这篇关于安卓:ViewFlipper或者ViewPager - 哪一个是更好的选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆