diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/CustomFontImageIconShouldDisplay.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/CustomFontImageIconShouldDisplay.png new file mode 100644 index 000000000000..522417743159 Binary files /dev/null and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/CustomFontImageIconShouldDisplay.png differ diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue8244.xaml b/src/Controls/tests/TestCases.HostApp/Issues/Issue8244.xaml new file mode 100644 index 000000000000..2be8b1e47827 --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue8244.xaml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue8244.xaml.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue8244.xaml.cs new file mode 100644 index 000000000000..2bfd2e66cc23 --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue8244.xaml.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Maui.Controls.Sample.Issues +{ + [XamlCompilation(XamlCompilationOptions.Compile)] + [Issue(IssueTracker.Github, 8244, "[iOS]Custom font icon is not rendered in a shell tabbar tab", + PlatformAffected.iOS)] + public partial class Issue8244 : Shell + { + public Issue8244() + { + InitializeComponent(); + } + } + public partial class MainTabPage : ContentPage + { + public MainTabPage() + { + Content = new VerticalStackLayout() + { + new Label(){ + Text = "Page Loaded in first Tab", + AutomationId="TabBarIcon", + VerticalOptions = LayoutOptions.Center, + HorizontalOptions = LayoutOptions.Center, + TextDecorations = TextDecorations.Underline, + + }, + }; + } + } + + public partial class SecondTabPage : ContentPage + { + public SecondTabPage() + { + Content = new VerticalStackLayout() + { + new Label(){ + Text = "Page Loaded in Second Tab", + VerticalOptions = LayoutOptions.Center, + HorizontalOptions = LayoutOptions.Center, + TextDecorations = TextDecorations.Underline, + + }, + }; + } + } + public partial class ThirdTabPage : ContentPage + { + public ThirdTabPage() + { + Content = new VerticalStackLayout() + { + new Label(){ + Text = "Page Loaded in Third Tab", + VerticalOptions = LayoutOptions.Center, + HorizontalOptions = LayoutOptions.Center, + TextDecorations = TextDecorations.Underline, + + }, + }; + } + } + + static class IconFont + { + public const string Laptop = "\uf109"; + public const string LaptopFile = "\ue51d"; + public const string LaptopCode = "\uf5fc"; + public const string LaptopMedical = "\uf812"; + public const string Plus = "\u002b"; + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8244.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8244.cs new file mode 100644 index 000000000000..4353477d1f89 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8244.cs @@ -0,0 +1,32 @@ +#if !MACCATALYST +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework.Legacy; +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues +{ + internal class Issue8244 : _IssuesUITest + { + public override string Issue => "[iOS]Custom font icon is not rendered in a shell tabbar tab"; + + public Issue8244(TestDevice device) : base(device) + { + } + + [Test] + [Category(UITestCategories.Shell)] + public void CustomFontImageIconShouldDisplay() + { + // Is a iOS issue; see https://github.com/dotnet/maui/issues/8244 + App.WaitForElement("TabBarIcon"); + VerifyScreenshot(); + } + } +} +#endif \ No newline at end of file diff --git a/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/CustomFontImageIconShouldDisplay.png b/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/CustomFontImageIconShouldDisplay.png new file mode 100644 index 000000000000..c204e4c6d794 Binary files /dev/null and b/src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/CustomFontImageIconShouldDisplay.png differ diff --git a/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/CustomFontImageIconShouldDisplay.png b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/CustomFontImageIconShouldDisplay.png new file mode 100644 index 000000000000..29b23bfe8805 Binary files /dev/null and b/src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/CustomFontImageIconShouldDisplay.png differ diff --git a/src/Core/src/ImageSources/iOS/ImageSourceExtensions.cs b/src/Core/src/ImageSources/iOS/ImageSourceExtensions.cs index 8b56ede4286e..2ce7003ffc06 100644 --- a/src/Core/src/ImageSources/iOS/ImageSourceExtensions.cs +++ b/src/Core/src/ImageSources/iOS/ImageSourceExtensions.cs @@ -48,7 +48,7 @@ public static partial class ImageSourceExtensions var image = UIGraphics.GetImageFromCurrentImageContext(); UIGraphics.EndImageContext(); - return image.ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal); + return image.ImageWithRenderingMode(UIImageRenderingMode.Automatic); } internal static UIImage? GetPlatformImage(this IFileImageSource imageSource)