語言

SharedElementCallback.OnSharedElementsArrived 方法

定義

在活動轉換期間呼叫,當共享元素抵達最終位置並準備轉移時。

[Android.Runtime.Register("onSharedElementsArrived", "(Ljava/util/List;Ljava/util/List;Landroid/app/SharedElementCallback$OnSharedElementsReadyListener;)V", "GetOnSharedElementsArrived_Ljava_util_List_Ljava_util_List_Landroid_app_SharedElementCallback_OnSharedElementsReadyListener_Handler", ApiSince=23)]
public virtual void OnSharedElementsArrived(System.Collections.Generic.IList<string>? sharedElementNames, System.Collections.Generic.IList<Android.Views.View>? sharedElements, Android.App.SharedElementCallback.IOnSharedElementsReadyListener? listener);
[<Android.Runtime.Register("onSharedElementsArrived", "(Ljava/util/List;Ljava/util/List;Landroid/app/SharedElementCallback$OnSharedElementsReadyListener;)V", "GetOnSharedElementsArrived_Ljava_util_List_Ljava_util_List_Landroid_app_SharedElementCallback_OnSharedElementsReadyListener_Handler", ApiSince=23)>]
abstract member OnSharedElementsArrived : System.Collections.Generic.IList<string> * System.Collections.Generic.IList<Android.Views.View> * Android.App.SharedElementCallback.IOnSharedElementsReadyListener -> unit
override this.OnSharedElementsArrived : System.Collections.Generic.IList<string> * System.Collections.Generic.IList<Android.Views.View> * Android.App.SharedElementCallback.IOnSharedElementsReadyListener -> unit

參數

sharedElementNames
IList<String>

清單:正在轉移的共用元素名稱。

sharedElements
IList<View>

清單:屬於檢視階層結構的共享元素。

listener
SharedElementCallback.IOnSharedElementsReadyListener

SharedElementCallback.OnSharedElementsReadyListener:當共享元素準備好隱藏於來源活動或顯示於目的地活動時,可呼叫的監聽器。

屬性

備註

在活動轉換期間呼叫,當共享元素抵達最終位置並準備轉移時。 此方法同時用於來源與目的活動。 當共享元素準備好傳輸時,必須呼叫 OnSharedElementsReadyListener.onSharedElementsReady() 來觸發傳輸。 預設行為是立即觸發傳輸。

本頁內容與程式碼範例受內容授權條款所規範。 Java 和 OpenJDK 是 Oracle 和/或其關係企業的商標或注冊商標。

最後更新於 2026-08-03 UTC。

Android 參考資料。android.app.SharedElementCallback.onSharedElementsArrived

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於