Skip to content

Commit 642a352

Browse files
authored
Fix shadow consistency on Android and iOS (#24415)
* Fix shadow consistency on Android and iOS * Update test screenshots
1 parent 14b29b0 commit 642a352

12 files changed

Lines changed: 97 additions & 12 deletions

File tree

72.1 KB
Loading
4.65 KB
Loading
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
x:Class="Maui.Controls.Sample.Issues.Issue24414"
5+
Title="Issue24414">
6+
7+
<Grid RowDefinitions="Auto,*,*" RowSpacing="24">
8+
<Label Text="Shadows" AutomationId="WaitForStubControl" />
9+
<Border Grid.Row="1"
10+
HeightRequest="248"
11+
WidthRequest="248"
12+
VerticalOptions="Center"
13+
HorizontalOptions="Center"
14+
StrokeShape="{RoundRectangle CornerRadius=24}"
15+
Stroke="Black"
16+
Padding="24" />
17+
<Border Grid.Row="1"
18+
HeightRequest="200"
19+
WidthRequest="200"
20+
VerticalOptions="Center"
21+
HorizontalOptions="Center"
22+
StrokeShape="{RoundRectangle CornerRadius=24}"
23+
Background="LightGreen"
24+
Shadow="{Shadow Brush=Black, Offset='0,0', Radius=24, Opacity=1}" />
25+
<Border Grid.Row="2"
26+
HeightRequest="248"
27+
WidthRequest="248"
28+
VerticalOptions="Center"
29+
HorizontalOptions="Center"
30+
StrokeShape="{RoundRectangle CornerRadius=24}"
31+
Stroke="Black"
32+
Padding="24" />
33+
<Border Grid.Row="2"
34+
HeightRequest="200"
35+
WidthRequest="200"
36+
VerticalOptions="Center"
37+
HorizontalOptions="Center"
38+
StrokeShape="{RoundRectangle CornerRadius=24}"
39+
Background="LightGreen"
40+
Shadow="{Shadow Brush=Black, Offset='24,24', Radius=24, Opacity=1}" />
41+
</Grid>
42+
</ContentPage>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using Microsoft.Maui;
3+
using Microsoft.Maui.Controls;
4+
using Microsoft.Maui.Controls.Xaml;
5+
6+
namespace Maui.Controls.Sample.Issues;
7+
8+
[XamlCompilation(XamlCompilationOptions.Compile)]
9+
[Issue(IssueTracker.Github, 24414, "Shadows not rendering as expected on Android and iOS", PlatformAffected.Android | PlatformAffected.iOS)]
10+
11+
public partial class Issue24414 : ContentPage
12+
{
13+
public Issue24414()
14+
{
15+
InitializeComponent();
16+
}
17+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using NUnit.Framework;
2+
using UITest.Appium;
3+
using UITest.Core;
4+
5+
namespace Microsoft.Maui.TestCases.Tests.Issues
6+
{
7+
public class Issue24414 : _IssuesUITest
8+
{
9+
public Issue24414(TestDevice device)
10+
: base(device)
11+
{ }
12+
13+
public override string Issue => "Shadows not rendering as expected on Android and iOS";
14+
15+
[Test]
16+
[Category(UITestCategories.Visual)]
17+
public void Issue24414Test()
18+
{
19+
App.WaitForElement("WaitForStubControl");
20+
VerifyScreenshot();
21+
}
22+
}
23+
}
22.1 KB
Loading
-4.04 KB
Loading
85.5 KB
Loading
-6.22 KB
Loading

src/Core/src/Core/IShadow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public interface IShadow
1919

2020
/// <summary>
2121
/// The Paint used to colorize the Shadow.
22-
/// At this time only SoliPaint works in all platforms
22+
/// At this time only SolidPaint works in all platforms
2323
/// </summary>
2424
Paint Paint { get; }
2525

0 commit comments

Comments
 (0)