【问题标题】:Android Horizontal Scroll VIew like galleryAndroid Horizo​​ntal Scroll View like Gallery
【发布时间】:2015-09-30 12:12:42
【问题描述】:

我想在 android 中制作类似画廊视图的水平滚动视图,其中居中的图像在滚动时会放大。经常在网上看到,但我在安卓中没有找到。下面是一个 iOS 应用的示例。

我尝试过使用 Horizo​​ntalScrollView、ListView、ViewPager,但在滚动时无法在中心再现缩放效果,并且下一张图片来自后面。

【问题讨论】:

  • Horizo​​ntalScrollView 出了什么问题?
  • 滚动时无法在中心再现放大效果,下一张图片来自后面
  • 好吧......也许你没有搜索好:stackoverflow.com/questions/20583033/…“Cover Flow”风格是你需要的(但去掉角度)。在问题和答案中,您有几个库。
  • 这里有更多:android-arsenal.com/tag/154
  • 尝试使用 Coverflow 第三方......

标签: android android-animation android-scrollview android-gallery android-scroll


【解决方案1】:

您可以使用 CoverFlow 。它是一个具有多种精美效果的 Android 视图。

  1. https://github.com/davidschreiber/FancyCoverFlow
  2. https://github.com/moondroid/CoverFlow

【讨论】:

  • 我正在使用moondroid/CoverFlow,但只有一个问题,我想删除无限循环。有什么建议吗?
【解决方案2】:

也许您可以在 TabHost 中使用 ViewPager 来获得接近您正在寻找的东西。

<TabHost
        android:id="@+id/calendar_add_edit_th"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content">

            <LinearLayout
                android:id="@+id/ll_tabs_com"
                android:layout_width="match_parent"
                android:layout_height="40dp"
                android:baselineAligned="false"
                android:orientation="horizontal"
                android:weightSum="1">

                <TabWidget
                    android:id="@android:id/tabs"
                    android:layout_width="match_parent"
                    android:layout_height="37dp"
                    android:layout_gravity="bottom" 
                    android:orientation="horizontal" />
            </LinearLayout>


            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_below="@+id/ll_tabs_com"
                android:background="#fff" />

            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/ll_tabs_com">

                <android.support.v4.view.ViewPager
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:background="#fff" />

            </RelativeLayout>
        </RelativeLayout>
    </TabHost>

【讨论】:

    【解决方案3】:

    您可以根据Android文档直接使用带有深度页面转换的View Pager来实现。

    您可以像这样实现:Demo of ViewPager

    要实现这种View View Pager with Transformation Speed in Android

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-13
      • 2019-03-30
      • 2011-02-27
      相关资源
      最近更新 更多