xamarin/Xamarin.Forms

Long Pressed Effect cannot be applied to ViewCell

开放

#7,501 创建于 2019年9月13日

 (6 条评论) (0 个反应) (0 位负责人)C# (1,926 个派生)batch import
a/gestures 🖖a/listviewe/7 :clock7:help wantedp/Androidpartner/cat 😻t/bug :bug:up-for-grabs

仓库指标

星标
 (5,644 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Description

I have discussed this with David Ortinau about this request. I have a customer who's trying to implement a long pressed event on a ListView's ViewCell or its inside control such as StackLayout or Grid. David provided a link that I followed before: here is the link David thought if this is not working, then might be a bug with Xamarin.Forms, hence here is the issue to identify whether this is a bug or whether I am doing it wrongly. I have implemented the same and got 2 issues described as below:

  1. If I apply this effect to ViewCell element, it's not working at all. The ViewCell just remain its own feature.
  2. If I apply this effect to ViewCell's child element, in my case, it's StackLayout, the LongPressedEffect is working, but the ViewCell has lost all its original feature such as TappedEvent.

If there is a correct approach to implement this, please do let me know because customer is eager to have the answer for this issue.

Steps to Reproduce

  1. Download my sample project from: Project here
  2. Run the sample project and it's currently applied to the ViewCell.
  3. You will see that the Effect is not working at all.

Expected Behavior

The ViewCell can respond to the LongPressedEffect and remain its own original features. Also, customer wants to know if this eventually needs technology such as Custom Renderer, whether it can connects with .NET Standard project which means that implement a Long Pressed Event to bind with some control?

Actual Behavior

  1. If I apply this effect to ViewCell element, it's not working at all. The ViewCell just remain its own feature.
  2. If I apply this effect to ViewCell's child element, in my case, it's StackLayout, the LongPressedEffect is working, but the ViewCell has lost all its original feature such as TappedEvent.

Basic Information

  • Version with issue: Latest version of Xamarin.Forms.
  • Last known good version: None.
  • IDE: Visual Studio 2019
  • Platform Target Frameworks:
    • Android: Android 8+
  • Android Support Library Version: 28.0.0.1

Screenshots

No, just run the app and you will see.

Reproduction Link

Project here

贡献者指南