2013-07-16 44 views
3

我的应用程序的工作中,库需要为波纹管图像:画廊以两边

enter image description here

我搜索了互联网,但它给人造成类似的图片廊。但我想创建一个以循环方式移动的画廊,意味着它只是弯曲画廊的第一个和最后一个成员。可能吗?或者是horizontal ScrollView更好的方法来做到这一点?

没有更好的办法将提前感激..谢谢。

+0

可能重复:[点击这里](http://stackoverflow.com/questions/3393918/how-to-implement-an-endless-gallery-in-android) – krishna

+0

谢谢克里希纳。但是我想在视觉上没有功能上的圆形效果。画廊应该看起来像弯曲的边缘。任何建议.... –

回答

2

我已经找到了解决方案,它使用Custom Gallery实现。我用下面的布局文件为

main.xml

<?xml version="1.0" encoding="utf-8"?> 
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/linear_layout" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:background="@drawable/gal_bg" 
     android:orientation="vertical" > 

     <Gallery 
      android:id="@+id/horizontallistview" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginLeft="40dp" 
      android:layout_marginRight="40dp" /> 
     <!-- android:background="@drawable/gal_overlay" --> 

     <ImageView 
      android:layout_width="fill_parent" 
      android:layout_height="120dp" 
      android:background="@drawable/gal_overlay" /> 

    </FrameLayout> 

而它采用了一些图片作为背景,以FrameLayoutImageView。您可以在GitHub找到完整的项目源代码。

编码快乐..

+2

谢谢..这是非常有用的.. –