Forum Xamarin.Forms

Listview without tapping and higlighting. Only for displaying informations

enzyklopenzyklop DEMember ✭✭

Hi there,

I'm searching a solution for a listview which is not tappable. I only want to display some informations via this view - there should be no highlighting by tapping or any action after a tap. Is there still an existing workaround?

Thank you for your help.

Best Answers

  • TorbenKruseTorbenKruse DE ✭✭✭
    edited August 2015 Accepted Answer

    set the cell to IsEnabled = false;

  • TorbenKruseTorbenKruse DE ✭✭✭
    Accepted Answer

    @LoriLalonde This only deactivates the selection, not the highlighting when tapping. Setting IsEnabled = false; will do both, while still let you scroll through the ListView.

Answers

  • TorbenKruseTorbenKruse DEMember ✭✭✭
    edited August 2015 Accepted Answer

    set the cell to IsEnabled = false;

  • LoriLalondeLoriLalonde CAInsider, University, Developer Group Leader ✭✭✭

    When setting up your ListView, simply wire up the event handler to the ItemSelected event to disable the selection as follows:

    MyListView.ItemSelected += (sender, e) => {
        ((ListView)sender).SelectedItem = null;
    };
    
  • TorbenKruseTorbenKruse DEMember ✭✭✭
    Accepted Answer

    @LoriLalonde This only deactivates the selection, not the highlighting when tapping. Setting IsEnabled = false; will do both, while still let you scroll through the ListView.

  • enzyklopenzyklop DEMember ✭✭

    @LoriLalonde Thanks, but @TorbenKruse is right. That does not deactivate the highlighting.

    @TorbenKruse I thought if I would disable the cell, that the cell will become a bit more gray. Like a disabled button. Next time I should defenitely test it before asking! :smiley: Thank you for your help!

  • UnreachableCodeUnreachableCode USMember ✭✭✭

    I've used a binding for my cells IsEnabled property but the problem is the tap still goes through once the bound property is changed even though it should be disabling it.

Sign In or Register to comment.