Skip to content

Commit 4aa9e0c

Browse files
[Testing] Fixed Test case failure in PR 30115 - [2025/06/23] Candidate (#30136)
* Resaved the Snapshots * Update ImagePaintWithDownsize.png * update mac image * Updated test failures * Added mac and windows images from CI --------- Co-authored-by: Anandhan Rajagopal <[email protected]>
1 parent ea1b786 commit 4aa9e0c

21 files changed

+58
-29
lines changed
Loading
Loading
Loading
Loading

src/Controls/tests/TestCases.HostApp/Issues/Issue24061.xaml

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<VerticalStackLayout>
77
<ScrollView Orientation="Horizontal"
88
x:Name="scrollView"
9-
HeightRequest="120">
10-
9+
HeightRequest="120"
10+
HorizontalScrollBarVisibility="Never">
1111
<ScrollView.Background>
1212
<LinearGradientBrush StartPoint="0,0.5"
1313
EndPoint="1,0.5">
@@ -19,29 +19,37 @@
1919
</LinearGradientBrush.GradientStops>
2020
</LinearGradientBrush>
2121
</ScrollView.Background>
22-
<StackLayout Orientation="Horizontal">
23-
<BindableLayout.ItemsSource>
24-
<x:Array Type="{x:Type x:String}">
25-
<x:String>Item1</x:String>
26-
<x:String>Item2</x:String>
27-
<x:String>Item3</x:String>
28-
<x:String>Item4</x:String>
29-
<x:String>Item5</x:String>
30-
</x:Array>
31-
</BindableLayout.ItemsSource>
32-
<BindableLayout.ItemTemplate>
33-
<DataTemplate>
34-
<BoxView WidthRequest="100"
35-
HeightRequest="100"
36-
AutomationId="{Binding .}"
37-
BackgroundColor="Black"
38-
Margin="10"/>
39-
</DataTemplate>
40-
</BindableLayout.ItemTemplate>
41-
</StackLayout>
22+
<StackLayout Orientation="Horizontal">
23+
<BindableLayout.ItemsSource>
24+
<x:Array Type="{x:Type x:String}">
25+
<x:String>Item1</x:String>
26+
<x:String>Item2</x:String>
27+
<x:String>Item3</x:String>
28+
<x:String>Item4</x:String>
29+
<x:String>Item5</x:String>
30+
<x:String>Item6</x:String>
31+
<x:String>Item7</x:String>
32+
<x:String>Item8</x:String>
33+
<x:String>Item9</x:String>
34+
<x:String>Item10</x:String>
35+
</x:Array>
36+
</BindableLayout.ItemsSource>
37+
<BindableLayout.ItemTemplate>
38+
<DataTemplate>
39+
<BoxView WidthRequest="100"
40+
HeightRequest="100"
41+
AutomationId="{Binding .}"
42+
BackgroundColor="Black"
43+
Margin="10"/>
44+
</DataTemplate>
45+
</BindableLayout.ItemTemplate>
46+
</StackLayout>
4247
</ScrollView>
4348
<Button AutomationId="button"
4449
Clicked="Button_Clicked"
4550
Text="Remove/Add scroll view background"/>
51+
<Button AutomationId="scrollButton"
52+
Clicked="ScrollButton_Clicked"
53+
Text="Scroll to End"/>
4654
</VerticalStackLayout>
4755
</ContentPage>

src/Controls/tests/TestCases.HostApp/Issues/Issue24061.xaml.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,21 @@ public Issue24061()
2323

2424
private void Button_Clicked(object sender, EventArgs e)
2525
{
26-
if (scrollView.Background != null)
27-
scrollView.Background = null;
26+
if (scrollView.Background is LinearGradientBrush)
27+
{
28+
// Setting background to null will not reset to color on Android, Refer: https://github.com/dotnet/maui/issues/22914
29+
//scrollView.Background = null;
30+
scrollView.Background = new SolidColorBrush(Colors.White);
31+
}
32+
2833
else
2934
scrollView.Background = _linearGradientBrush;
3035
}
36+
37+
private async void ScrollButton_Clicked(object sender, EventArgs e)
38+
{
39+
// Scroll to the end of the horizontal ScrollView
40+
await scrollView.ScrollToAsync(scrollView.ContentSize.Width, 0, false);
41+
}
3142
}
3243
}

0 commit comments

Comments
 (0)