2015-03-19 10 views
5

मैं नमूना उदाहरण का उपयोग एक से अधिक साझा तत्वों पर एनीमेशन संक्रमण को लागू करने की कोशिश कर रहे हैं के लिए makeSceneTransition एंड्रॉयड साइटएंड्रॉयड: एक से अधिक साझा तत्वों

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

पर पता चला है लेकिन जब मैं इस कोड को लागू करने के लिए कोशिश ग्रहण आईडीई में मेरे उदाहरण के आवेदन पर यह कहते हैं कि

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

मैं वहां कुछ मदद का उपयोग कर सकता था। धन्यवाद।

उत्तर

1

मैं बस एक ही मुद्दे पर आया था। मेरे मामले में मैं

import android.support.v4.util.Pair; 

बजाय

import android.util.Pair; 
0

मेरे मामले में आयात करने के बाद, मैं, imageView और linearLayout पारित करने के लिए है, जबकि विधि Views उम्मीद कर रहा था कोशिश कर रहा था।

तो मैंने किया, View view1 = imageView; और View view2 = linearLayout। और उन्हें विधि में पास कर दिया।

संबंधित मुद्दे