Joyce de Lanna
Joyce de Lanna

Reputation: 1543

How can I disable the click in a list view? xamarin.form

I've searched and I've not found the answer yet. I need to disable the click that happens in each item of a list and makes it be blue, as if it is selected. The problem is that my list items aren't selectables items, my list is only for the user see some informations.

Upvotes: 2

Views: 4448

Answers (2)

Uraitz
Uraitz

Reputation: 496

you can use IsEnabled = "False" as Barney said Or otherwise asign null value to selected item after selection event.

<ListView ItemSelected="ListView_ItemSelected" />

...

private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
{
      var list = (ListView)sender;
      list.SelectedItem = null;
}

Upvotes: 4

Barney Chambers
Barney Chambers

Reputation: 2783

Add IsEnabled="False" into your ListView as shown here

<ListView IsEnabled="False">

Upvotes: 2

Related Questions