Multiple spinners

Asked

Viewed 66 times

0

I’m creating an app where I have a TableLayout, in which I add TableRow dynamically with Spinners and TextEdit.

It is possible to create a EventHandler common to all Spinners?

1 answer

2


I don’t know if this is what you want, but you can assign the events of multiple objects to the same function:

FindViewById<Spinner>(Resource.Id.Spn1).Click += EventoClick_Click;
FindViewById<Spinner>(Resource.Id.Spn2).Click += EventoClick_Click;

private void EventoClick_Click(object sender, EventArgs e)
{
   //Aqui você pode manipular o objeto que chamou o evento usando o sender           
}
  • 1

    Thank you was right.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.