【问题标题】:what is this image gallery called in android [closed]这个图片库在android中叫什么[关闭]
【发布时间】:2014-12-11 05:59:23
【问题描述】:

我计划在 android 中构建这种图像视图,我可以在如何开始时使用您的帮助。

【问题讨论】:

  • @MagicalPhoenixϡ 你能否提供这个作为答案,因为你的答案是正确的并且想选择那个
  • 我添加了答案,快乐编码:)
  • 谢谢你,但你如何跟上这些不断变化的步伐,你能推荐一些好的博客让我开始这些设计
  • 我只是通过谷歌搜索来学习..当有一些要求时,我会在谷歌上搜索我最好的选择:)

标签: java android android-gallery


【解决方案1】:

从另一个SO thread提取

查看这个封面流小部件,它的工作原理类似于 listView,因此使用起来非常简单:

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

步骤:

  • 在您的类路径中导入库类
  • 使用 CoverFlow 代替 ListView
  • 编写你的coverflowAdapter,这里它将只包含图像(参见 链接中的示例代码)
  • 将适配器设置为您的coverflow

希望对你有帮助!

【讨论】:

    【解决方案2】:

    它叫Carousel

    看到这个:carousel layout android

    如果你想要3D轮播,可以看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);
        }
    
    }
    

    您可以根据需要自定义代码,制作水平旋转木马或垂直旋转木马。

    希望这会有所帮助。

    【讨论】:

    猜你喜欢
    • 2023-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-22
    • 1970-01-01
    • 2022-01-25
    • 2021-06-08
    相关资源
    最近更新 更多