Я хочу получить: «ID» выбранного элемента из счетчика.Как получить идентификатор счетчика?
Вот мой код:
var sterren1Lems = new String[]
{
"1 out of 5 stars", "2 out of 5 stars", "3 out of 5 stars", "4 out of 5 stars", "5 out of 5 stars"
};
sterren2Lems = FindViewById<Spinner>(Resource.Id.sterrenLems);
sterren2Lems.Adapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, sterren1Lems);
TextView test = FindViewById<TextView>(Resource.Id.test);
sterren2Lems.ItemSelected += delegate
{
test.Text = sterren1Lems[Convert.ToInt32(sterren2Lems.SelectedItemId)];
};
Пожалуйста, помогите мне!
Один намек первым получить текст и 'substring' его. –
Почему я должен использовать подстроку, когда мне нужен только: id/value выделенного текста? –
Вы не хотите получать «1» из «1 из 5 звезд»? –