Hide or Cancel context action on List View

Hi,

When using context menu in list view (Xamarin Forms), when user long press item, it shows Context action menu bar.

If user don't want to take any action, then can click the back arrow button on top (at context action bar itself).

How to hide context action menu bar or cancel if user click outside context menu bar i-e- any where on screen or any other list view item

Thanks

Best Answer

Answers

  • Amit_Malhi01Amit_Malhi01 Member ✭✭

    Disable Context Action click

    ViewCell.ContextActions.Clear();

  • toughcannytoughcanny Member ✭✭

    Hi @ColeX

    Thanks It works only when we click outside listview (that transparent button appears below listview)
    It wouldn't work when we click any where on screen, for example clicking an item on list view item should close that.

  • ColeXColeX Member, Xamarin Team Xamurai
  • toughcannytoughcanny Member ✭✭

    Thanks @ColeX

    The difference was that listview was inside StackLayout, after moving it to inside Grid it Works.

Sign In or Register to comment.