安卓:ViewFlipper或者ViewPager - 这是更好的选择? [英] Android : ViewFlipper Or ViewPager - Which is Better Option?

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

问题描述

我收到一期卡住。我总有20到25张图片,应该让动画像ViewPager不会。现在,在所有影像上我有点击事件。我DNT知道如果我要工作,ViewPager还是ViewFlipper?我可以实现两件事。没有问题的吧。

I am Getting Stuck in One Stage. I have Total 20 to 25 Images that should get Animated like ViewPager Does. Now on All the Images I have Click Events. And I Dnt Knew if I should Work With ViewPager Or ViewFlipper? I can Implement Both Things. No Issues in it.

我想要的东西:我只想要一个建议,据我的问题,这将是最好的选择ViewFlipper或ViewPager

What I Want : I just Want a Suggestion that According to My Problem Which Will be Best Option ViewFlipper or ViewPager?

我寻觅什么:我已经通过不同的链接走了<一href="http://stackoverflow.com/questions/7338351/how-to-improve-the-performance-of-viewflipper-viewanimator">HERE和这里的计算器,但无法找到我想要的东西。

What I Have Searched : I have Gone through Different Links HERE and HERE on StackOverflow but Could Not Find the Thing I want.

我曾在ViewPager一些什么。但当时我有管理有只有3或4个片段。如果我用它来解决这个问题,我要管理25片段这个时候。所以我想知道如果任何其他可能更好的解决方案可以提供。

I have Worked on ViewPager some what. but At that time there were just 3 or 4 Fragments I have to Manage. and if I have Used it to solve this problem I have to manage 25 Fragments this time. So I am wondering if any other possible better solution can 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天全站免登陆