Bug 40320 - Custom CellView is drawn not drawn properly with Context Actions and UnevenRows in ListView
Summary: Custom CellView is drawn not drawn properly with Context Actions and UnevenRo...
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 2.1.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Rui Marinho
Depends on:
Reported: 2016-04-12 21:35 UTC by Lester Meeks
Modified: 2017-06-19 18:32 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

Possible Fertile Day Redraw Artifact (97.84 KB, image/png)
2016-04-12 21:35 UTC, Lester Meeks
Possible Fertile Day No Context Action, No Artifact (102.60 KB, image/png)
2016-04-12 22:34 UTC, Lester Meeks
Cell Artifact with Context Action Exposed (96.31 KB, image/png)
2016-04-12 23:12 UTC, Lester Meeks

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Lester Meeks 2016-04-12 21:35:26 UTC
Created attachment 15684 [details]
Possible Fertile Day Redraw Artifact

I use a custom cell with a stack layout and some labels, these labels can resize based on how much text is in them.  This is working great except for when i add a context menu item to them at runtime.  The cell ends up drawn poorly and with black artifacts in it, the click animation is also black for these cells.
Comment 1 Lester Meeks 2016-04-12 22:34:08 UTC
Created attachment 15685 [details]
Possible Fertile Day No Context Action, No Artifact

This is a capture of the expected display, and how it looks when you add the item to the list WITHOUT an associated context item
Comment 2 Lester Meeks 2016-04-12 23:12:53 UTC
Created attachment 15686 [details]
Cell Artifact with Context Action Exposed

Cell Artifact with Context Action Exposed: demonstrates the sizing of the cell height and the context height is correct for the overall size.
Comment 3 Lester Meeks 2016-04-13 01:43:21 UTC
also repro's in 2.2.0 pre 2 for me.  It is a killer for my app.
Comment 4 Lester Meeks 2016-04-13 18:32:01 UTC
I have some testing that indicates that when creating context actions in the cell constructor it is sized and drawn correctly.

I am using the ContextChanged property to dynamically create context actions.  This code seems to be related to the broke drawing in my cell.        

protected override void OnBindingContextChanged()
            //await View.TranslateTo(-View.Width, 0, 1000);

            //View.Scale = 0;
            if (!String.IsNullOrEmpty(ContextAction1Text) && ContextAction1Command != null)
                ContextActions.Add(new MenuItem
                    Text = ContextAction1Text, 
                    IsDestructive = ContextAction1IsDestructive,
                    Command = new Command( (o) => {OnContextTapped( ContextAction1Command, ContextAction1CommandParameter );})}

            if (!String.IsNullOrEmpty(ContextAction2Text) && ContextAction2Command != null)
                ContextActions.Add(new MenuItem
                    Text = ContextAction2Text, 
                    IsDestructive = ContextAction2IsDestructive,
                    Command = new Command( (o) => {OnContextTapped( ContextAction2Command, ContextAction2CommandParameter );})}
Comment 5 Rui Marinho 2016-04-20 15:26:00 UTC
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue, we would very much appreciate it. 

For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team
Comment 6 Samantha Houts [MSFT] 2017-06-19 18:32:54 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!