roubachof/Sharpnado.Presentation.Forms

[HorizontalListView] Inconsistent behaviour for custom renderer in the view cell

Closed this issue · 2 comments

Platform:

  • OS: [iOS]

  • Device: [iPhoneSimulator]

  • Sdk vervion: [iOS 12]

  • OS: [Android]

  • Device: [AndroidEmulator]

  • Sdk vervion: [Android SDK 28]

  • Xamarin.Forms: [4.6.0.1141] (same in XamarinForms 4.8)

Describe the bug
Tried to add a gradient label into HorizontalListView, but got different behaviour on Android and iOS.
On Android needs a Stacklayout in the view cell (which is my preferred way) to display the gradient.
While on iOS it works when the gradient label is the only element in the view cell.

As I put a gradient label outside the list, which works fine,
I assume something happened in the ListView renderer.
Please also check the one-page-sample uploaded.

To Reproduce
Steps to reproduce the behaviour:

  1. Create a blank XF project.
  2. Add HorizontalListView in MainPage
  3. Add "GradientLabel", "GradientLabelRenderer" and "GradientLabelRenderer" to each platform project
  4. Deploy on different platforms and check the colour

Screenshots (if applicable)
image-20201022145738820
image-20201022151120456

Unfortunately I have no control on how the native view is produced from the xf view.
It's classic framework internal stuff.
Only the gradientlabel library creator could do something about this.

Right, I got the same result from native ListView, seems I focused on the wrong variable when testing. Thanks.