【问题标题】:Android: makeSceneTransition for more than one shared elementsAndroid:makeSceneTransition 用于多个共享元素
【发布时间】:2015-03-19 06:15:00
【问题描述】:

我一直在尝试使用 android 网站上显示的示例在多个共享元素上实现动画过渡

    ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this,
    Pair.create(view1, "agreedName1"),
    Pair.create(view2, "agreedName2"));

但是当我尝试在 Eclipse IDE 中的示例应用程序上实现此代码时,它会显示

The method makeSceneTransitionAnimation(Activity, View, String) in the type ActivityOptions is not applicable for the arguments (MyActivity, Pair<View,String>, Pair<View,String>)

我可以在那里使用一些帮助。谢谢。

【问题讨论】:

    标签: android material-design android-transitions


    【解决方案1】:

    我刚刚遇到了同样的问题。就我而言,我已经导入了

    import android.support.v4.util.Pair;
    

    而不是

    import android.util.Pair;
    

    【讨论】:

      【解决方案2】:

      在我的案例中,我试图传递 imageViewlinearLayout,而该方法期待 Views

      所以我做到了,View view1 = imageView;View view2 = linearLayout。 并将它们传递给方法。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-06-29
        • 2020-04-29
        • 1970-01-01
        • 2020-05-09
        • 1970-01-01
        • 1970-01-01
        • 2018-07-14
        • 1970-01-01
        相关资源
        最近更新 更多