How to get the data of a ListView item the user has clicked on with listview.GetItemAtPosition(e.Position)?

后端 未结 6 1825
温柔的废话
温柔的废话 2021-01-23 00:36

in a Xamarin.Android app, I have a ListView which I previously populated. In the listview_ItemClick event handler, which correctly fires, I would like to retrieve the text of t

6条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-23 01:08

    You can have a Button that catch the Ítem Clicked...

    You can have the element Position like this.

    int position= FindViewById(Resource.Id.listIncindentes).CheckedItemPosition;

    And the element value like this.

    var value= FindViewById(Resource.Id.listIncindentes).GetItemAtPosition(position);

提交回复
热议问题