Repository navigation
Closed
Description
In the attached example I have an iOS control complete with handlers (MyCustomControl). It just draws a simple rectangle and has a background color property. I've arranged 3 of these in a SkiaRow and I have a toggle visibility button for the second rectangle which is bound to a IsRectangleVisible property on the MainPageViewModel. Here's the code the comments I've added in XAML explain the problem for the 2nd two scenarios.
For the 2nd rectangle:
IsRectangleVisible is set to true on SkiaMauiElement in VM but fallback value of false. So, when VM loads it should become visible.
When the page loads, space is allocated for SkiaMauiElement (it's visible), but MyCustomControl never appears even
after toggling the visibility from the button.
For the 3rd rectangle:
MyCustomControl is visible even though IsVisible compiled to to false.
If I change to true, then hot-reload it, then back to false then hot-reload, it dissappears with
space still allocated for SkiaMauiElement (which seems correct)
Here's the broader code:
<d:SkiaRow>
<d:SkiaMauiElement Grid.Row="0" VerticalOptions="Fill" IsVisible="True"
HorizontalOptions="Fill"
Width="50"
Margin="20"
HeightRequest="50">
<meacontrols:MyCustomControl
Margin="0, 0, 0, 0"
VerticalOptions="Start"
HeightRequest="20"
WidthRequest="50"
CustomBackgroundColor="LawnGreen"
HorizontalOptions="Fill"/>
</d:SkiaMauiElement>
<!--In this example, IsRectangleVisible is set to true in VM but fallback value of false. So, when VM loads it should become visible.
When the page loads, space is allocated for SkiaMauiElement (it's visible), but MyCustomControl never appears even
after toggling the visibility from the button.
If however, recompile with VM _isRectangleVisible = false instead of true, everything works as expected.-->
<d:SkiaMauiElement Grid.Row="0" VerticalOptions="Fill"
HorizontalOptions="Fill"
Width="50"
IsVisible="{Binding IsRectangleVisible, FallbackValue=False}"
Margin="20"
HeightRequest="50">
<meacontrols:MyCustomControl
Margin="0, 0, 0, 0"
VerticalOptions="Start"
IsVisible="True"
HeightRequest="20"
WidthRequest="50"
CustomBackgroundColor="DarkBlue"
HorizontalOptions="Fill"/>
</d:SkiaMauiElement>
<!--In this example, MyCustomControl is visible even though IsVisible compiled to to false.
If I change to true, then hot-reload it, then back to false then hot-reload, it dissappears with
space still allocated for SkiaMauiElement (which seems correct)-->
<d:SkiaMauiElement Grid.Row="0" VerticalOptions="Fill" IsVisible="True"
HorizontalOptions="Fill"
Width="50"
Margin="20"
HeightRequest="50">
<meacontrols:MyCustomControl
Margin="0, 0, 0, 0"
VerticalOptions="Start"
IsVisible="False"
HeightRequest="20"
WidthRequest="50"
CustomBackgroundColor="DarkMagenta"
HorizontalOptions="Fill"/>
</d:SkiaMauiElement>
</d:SkiaRow>
<d:SkiaRow Grid.Row="1">
<d:SkiaButton Grid.Row="1" Text="Toggle Visibility" Tapped="SkiaButton_Tapped"></d:SkiaButton>
<d:SkiaLabel Margin="10, 0, 0, 0" Text="{Binding IsRectangleVisible, StringFormat='Visible: {0}'}" />
</d:SkiaRow>
I've attached the sample solution as well.
Kind Regards!
Sean
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix: SkiaMauiElement shows its native view when it becomes visible af…
taublast commentedon Oct 17, 2026
Hey Sean, thanks for the sample, I reproduced both cases.
Please try the fix installing
DrawnUi.Maui 1.10.7.12-pre1(preview):Same fix is in for Android and Windows, please tell me if this nuget fixed it from your side, thanks!
sethom commentedon Oct 17, 2026
I'll try it out as soon as I can. Probably a little later tonight.
Thanks!
sethom commentedon Oct 18, 2026
Everything works fine now, thanks again!