Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 16114 [details]
I have a ListView with a custom ViewCell called MyTextCell, which contains a _viewLayout (a Horizontal StackLayout) which contains a _nameLayout (a Vertical StackLayout)
If I change the padding on _nameLayout and call ForceUpdateSize the cell does not resize.
If I change the padding on _viewLayout and call ForceUpdateSize the cell does resize.
In the attached test project Item One has the padding added to the _nameLayout and Item Three has the padding added to the _viewLayout. The padding is not changed for Item Two. Both the Master and the Detail inflate the same page.
Can you describe or mock up an example of what you expect it to look like when the cells are resized?
You may find that changing the Margin instead of (or in addition to) the Padding produces your desired result.
I'm not following your question - I am expecting the cell to re-size taking into account the new padding, regardless of which object the padding is applied to.
In other words I would expect the cell to have the same height after the padding change and call to ForceUpdateSize as it would if the padding was in the definition of the cell.
While it seems not to matter which layout contains the padding in this super-simplified example, the example was designed to show the issue in the simplest possible terms, not create a realistic scenario.
Hm. Well, when I run this example project on Android, I do see both cells resize to take into account the padding. Are you not seeing the cells resize at all? Or are they resizing but not in the way you expected them to?
That is not what I see .. I see that Item 3 has both the padding increased and the Cell Size increased accordingly. As a result the text is lined up with the carrot and the red "padding" is visible on all 4 sides of the blue label.
Item 1 has the padding increased similarly, but because the Cell Size is not increased the label moves down in the cell so the full amount of the red top padding is visible, but the bottom of the cell cuts off the bottom red padding so it is not visible. It should have an equal amount of red padding on the top and bottom, but it doesn't, because the Cell has not re-sized to accommodate the new padding values. This is even more obvious if you change the background color on the second item by adding the definition in the OnBindingContextChanged event:
_descriptionLabel.IsVisible = true;
_viewLayout.BackgroundColor = Color.White;
I also increased the new padding to exaggerate the issue a bit more ... the new values are:
if (item.Key == 1)
_nameLayout.Padding = new Thickness(0, Device.OnPlatform(12, 10, 3));
if ( item.Key == 3)
_viewLayout.Padding = new Thickness(8, Device.OnPlatform(12, 14, 3));
I'll attach the result I get with these two changes, let me know if this is not what you are seeing.
Created attachment 16124 [details]
running in android
Thank you for the additional information!
This is still an issue using 220.127.116.11
My tests show this is no longer an issue in 2.5.0 :)