Vivek Nuna
Vivek Nuna

Reputation: 1

How to enable scroll for ListView while disabling the click on it in Xamarin?

I have a ListView. When I click on a row it flickers on Android app. I just want to disable this flickering. I have tried setting the IsEnabled property to false. But in this case, I cannot scroll by moving my finger up and down. So it there any way to stop this flickering without affecting other events?

Upvotes: 0

Views: 515

Answers (1)

Bruno Caceiro
Bruno Caceiro

Reputation: 7189

You should set the IsEnabled property to the ViewCell, not on the Listview:

<ViewCell IsEnabled="false">
    //Your Item Layout Coding
</ViewCell>

Another solution is unselecting instantly in the ItemTappedEvent:

YourList.ItemSelected+=DeselectItem;

 public void DeselectItem(object sender, EventArgs e)
  {
     ((ListView)sender).SelectedItem = null;
  }

Upvotes: 1

Related Questions