什么是在android中调用的图像库

时间:2014-12-11 05:59:24

标签: java android android-gallery

我打算在android中构建这种图像视图我可以使用你的帮助来开始。

enter image description here

enter image description here

2 个答案:

答案 0 :(得分:0)

从另一个SO thread

中提取

请参阅此Coverflow小部件,它的工作方式类似于listView,因此使用起来非常简单:

http://www.inter-fuser.com/2010/01/android-coverflow-widget.html

步骤:

  • 在类路径中导入库类
  • 使用CoverFlow
  • 代替ListView
  • 编写coverflowAdapter,此处仅包含图像(请参阅 来自链接的示例代码)
  • 将适配器设置为封面

希望它有所帮助!

答案 1 :(得分:-2)

它被称为Carousel

请参阅:carousel layout android

如果你想要3 D Carousel,你可以看到this post

您需要为图像创建自定义类,从而扩展ImageView。

示例:

public class CarouselImageView extends ImageView 
    implements Comparable<carouselimageview> {

    private int index;
    private float currentAngle;
    private float x;
    private float y;
    private float z;
    private boolean drawn;

    public CarouselImageView(Context context) {
        this(context, null, 0);
    }   

    public CarouselImageView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public CarouselImageView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public int compareTo(CarouselImageView another) {
        return (int)(another.z – this.z);
    }

}

您可以根据要求自定义代码,以制作水平轮播或垂直轮播。

希望这有帮助。