Bug 61191 - Label appears under native view gradient
Summary: Label appears under native view gradient
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Mac ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2018-01-29 21:15 UTC by John VanSickle
Modified: 2018-01-30 00:05 UTC (History)
2 users (show)

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

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:
Status:
RESOLVED ANSWERED

Description John VanSickle 2018-01-29 21:15:56 UTC
Label appears under a Grid when using custom renderer for the grid and adding a gradient on Mac OS 10.12.6. This layering issue does not appear when the application is run on Mac OS 10.13.2.

The gradient is being added in the OnElementPropertyChanged of the Grid's custom renderer by adding a CAGradientLayer to the NativeView.Layer. 

Custom renderer OnElementPropertyChanged:

var gradient = MakeGradientLayer();
NativeView.WantsLayer = true;
NativeView.Layer = new CALayer();
NativeView.Layer.AddSublayer(gradient);

The Grid:

<Grid x:Name="TheGrid" WidthRequest="210" HeightRequest="44" Grid.Row="1" Grid.Column="0" VerticalOptions="Center" Margin="0" Padding="0" ColumnSpacing="0" RowSpacing="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="44" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="36" />
                <ColumnDefinition Width="159" />
                <ColumnDefinition Width="15" />
            </Grid.ColumnDefinitions>
            <!--            <Button Text="Btn" Grid.Row="0" Grid.Column="0" HeightRequest="36" VerticalOptions="Center" Margin="5, 0, 5, 5" />-->
            <Label Text="The Label" FontFamily="Segoe UI" FontSize="14" FontAttributes="Bold" TextColor="Black" Margin="0, 0 ,0 ,5" VerticalOptions="Center" HorizontalOptions="Start" Grid.Row="0" Grid.Column="1" />
            <Button Text="-" Grid.Row="0" Grid.Column="2" VerticalOptions="Start" HeightRequest="15" Clicked="Minimize" />
        </Grid>
Comment 1 Paul DiPietro [MSFT] 2018-01-30 00:05:03 UTC
Bugzilla issues are no longer tracked. Please use GitHub issues.