Lenguaje

FragmentTransaction.Replace Método

Definición

Sobrecargas

Nombre Description
Replace(Int32, Fragment)

Llama a #replace(int, Fragment, String) con una etiqueta NULL.

Replace(Int32, Fragment, String)

Reemplace un fragmento existente que se agregó a un contenedor.

Replace(Int32, Fragment)

Llama a #replace(int, Fragment, String) con una etiqueta NULL.

[Android.Runtime.Register("replace", "(ILandroid/app/Fragment;)Landroid/app/FragmentTransaction;", "GetReplace_ILandroid_app_Fragment_Handler")]
public abstract Android.App.FragmentTransaction? Replace(int containerViewId, Android.App.Fragment? fragment);
[<Android.Runtime.Register("replace", "(ILandroid/app/Fragment;)Landroid/app/FragmentTransaction;", "GetReplace_ILandroid_app_Fragment_Handler")>]
abstract member Replace : int * Android.App.Fragment -> Android.App.FragmentTransaction

Parámetros

containerViewId
Int32

int

fragment
Fragment

Fragmento

Devoluciones

La misma instancia de FragmentTransaction, lo que permite encadenar operaciones de transacción adicionales.

Atributos

Comentarios

Llama a replace(int,Fragment,String) por una etiqueta NULL.

Referencia de Android para android.app.FragmentTransaction.replace.

Las partes de esta página son modificaciones basadas en el trabajo creado y compartido por el Android y se usan según los términos descritos en creative Creative Commons 2.5 Attribution License.

Se aplica a

Replace(Int32, Fragment, String)

Reemplace un fragmento existente que se agregó a un contenedor.

[Android.Runtime.Register("replace", "(ILandroid/app/Fragment;Ljava/lang/String;)Landroid/app/FragmentTransaction;", "GetReplace_ILandroid_app_Fragment_Ljava_lang_String_Handler")]
public abstract Android.App.FragmentTransaction? Replace(int containerViewId, Android.App.Fragment? fragment, string? tag);
[<Android.Runtime.Register("replace", "(ILandroid/app/Fragment;Ljava/lang/String;)Landroid/app/FragmentTransaction;", "GetReplace_ILandroid_app_Fragment_Ljava_lang_String_Handler")>]
abstract member Replace : int * Android.App.Fragment * string -> Android.App.FragmentTransaction

Parámetros

containerViewId
Int32

Identificador del contenedor cuyos fragmentos se van a reemplazar.

fragment
Fragment

Nuevo fragmento que se va a colocar en el contenedor.

tag
String

Nombre de etiqueta opcional para el fragmento, para recuperar posteriormente el fragmento con FragmentManager#findFragmentByTag(String) FragmentManager.findFragmentByTag(String).

Devoluciones

Devuelve la misma instancia de FragmentTransaction.

Atributos

Comentarios

Reemplace un fragmento existente que se agregó a un contenedor. Esto es básicamente lo mismo que llamar a remove(Fragment) para todos los fragmentos agregados actualmente que se agregaron con el mismo containerViewId y, a continuación, add(int,Fragment,String) con los mismos argumentos proporcionados aquí.

Referencia de Android para android.app.FragmentTransaction.replace.

Las partes de esta página son modificaciones basadas en el trabajo creado y compartido por el Android y se usan según los términos descritos en creative Creative Commons 2.5 Attribution License.

Se aplica a