【问题标题】:swipe images in android在android中滑动图像
【发布时间】:2011-10-15 21:40:41
【问题描述】:

我需要一些关于如何为 Android 进行滑动图像查看器的信息。完全像这样的东西:http://www.photoswipe.com/latest/examples/jquery-mobile.html#&ui-state=dialog。我有一个 listView,我希望每次单击一个 listview 项目时都会打开一个新窗口全屏选择的图像,当我在图像上选项卡时,显示带有左右按钮的底部和图像上方的一些信息。在全屏模式下,我希望能够左右滑动并显示不同的图像。

知道怎么做吗?非常感谢!

【问题讨论】:

    标签: android image fullscreen swipe


    【解决方案1】:

    在 viewflipper 中插入图像视图(这里称为 optionsVF)

    在你的 onClick 什么的:

    Animation in = AnimationFactory.inFromRight();
    in.setDuration(500);
    optionsVF.setInAnimation(in);
    Animation   out = AnimationFactory.outToLeft();
    out.setDuration(500);
    optionsVF.setOutAnimation(out);
    optionsVF.showNext();
    

    我的课 :) AnimationFactory

    /*
    *  Copyright 2011 Sherif
    */
    
    public class AnimationFactory {
        public static Animation inFromRight() {
        Animation inFromLeft = new TranslateAnimation(
        Animation.RELATIVE_TO_PARENT,  1.0f, Animation.RELATIVE_TO_PARENT,  0.0f,
        Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f
        );
        inFromLeft.setDuration(500);
        inFromLeft.setInterpolator(new AccelerateInterpolator());
        return inFromLeft;
        }
    
        public static Animation outToLeft() {
        Animation inFromLeft = new TranslateAnimation(
        Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,  -1.0f,
        Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f
        );
        inFromLeft.setDuration(500);
        inFromLeft.setInterpolator(new AccelerateInterpolator());
        return inFromLeft;
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多