Bug 48236

Summary: BackgroundColor for Stepper behaves differently on iOS to Android and UWP
Product: Forms Reporter: John Hardman <jsh001guard-z659>
Component: FormsAssignee: Bugzilla <bugzilla>
Status: RESOLVED FIXED    
Severity: normal CC: adrianknight89, jas, jsh001guard-z659, paul.dipietro, rui.marinho
Priority: Normal    
Version: 2.3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Tags: Stepper BackgroundColor UWP Android ac Is this bug a regression?: ---
Last known good build:
Attachments: Zip file containing screenshots from Android, iOS and UWP phones

Description John Hardman 2016-11-28 20:01:52 UTC
Created attachment 18699 [details]
Zip file containing screenshots from Android, iOS and UWP phones

The attached zip file contains three screenshots generated using the same code.

The bottom item on each screenshot is a Stepper, generated using the following code:

            Stepper stepper = new Stepper
            {
            };
            stepper.Increment = 1;
            stepper.Minimum = 0;
            stepper.Maximum = 28;
            stepper.Value = 1;
            stepper.BackgroundColor = Color.Pink;


On Android, the BackgroundColor is used for (what from the user's point of view is) the area on which the "-" and "+" buttons sit, with the buttons not using the BackgroundColor (having a silver/gray instead on my phone).

On UWP, the buttons AND the area on which they sit all have pink backgrounds (i.e. the BackgroundColor), which is clearly wrong.

On iOS, the buttons are pink (using the BackgroundColor) and the area on which they sit is presumably transparent, showing the color of the underlying layout.

Which is correct? Probably iOS, although possibly Android, but definitely not UWP which is clearly wrong.

Clearly, as a separate enhancement, one or two more Color properties need to be added (one if iOS is deemed to be correct, two if Android is deemed to be correct), but that is for after the fixing of BackgroundColor, which is just plain wrong.
Comment 1 adrianknight89 2016-11-29 01:34:47 UTC
This sounds like a breaking change.

I think iOS UIStepper has two buttons and the +/- signs are actually button images, so if you wanted to style the border color, you'd need to supply new background images. When you set the stepper to pink, you're updating the background color of the stepper and not touching its buttons. So, that's what's happening on iOS.

Android seems to be a linear layout with two child buttons as well. It's also updating the background color of the parent view and not touching the buttons.

Sounds like UWP is wrong.

It'd be nice to screenshot iOS and Android steppers in Xamarin native for comparison. How do they behave when their background color is changed?
Comment 2 Rui Marinho 2017-01-03 11:36:46 UTC
Should be fixed in 2.3.4-pre2