diff --git a/src/Controls/samples/Controls.Sample.UITests/Issues/Issue17022.xaml b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue17022.xaml
new file mode 100644
index 000000000000..818a40baa44a
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue17022.xaml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Controls/samples/Controls.Sample.UITests/Issues/Issue17022.xaml.cs b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue17022.xaml.cs
new file mode 100644
index 000000000000..f78d041d0787
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue17022.xaml.cs
@@ -0,0 +1,274 @@
+using Microsoft.Maui.Controls;
+using Microsoft.Maui.Controls.Xaml;
+using Microsoft.Maui.Graphics;
+using Microsoft.Maui.Controls.PlatformConfiguration;
+using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;
+using NavigationPage = Microsoft.Maui.Controls.NavigationPage;
+using FlyoutPage = Microsoft.Maui.Controls.FlyoutPage;
+
+namespace Maui.Controls.Sample.Issues;
+
+[XamlCompilation(XamlCompilationOptions.Compile)]
+[Issue(IssueTracker.Github, 17022, "UINavigationBar is Translucent", PlatformAffected.iOS)]
+public partial class Issue17022 : ContentPage
+{
+ public Issue17022()
+ {
+ InitializeComponent();
+ }
+
+ readonly string _topOfScreenText = "Green boxview should be behind navbar and touching very top of screen.";
+ readonly string _notTopOfScreenText = "Green boxview should NOT be behind navbar and NOT touching very top of screen.";
+
+ async void NewNavigationPagePressed(System.Object sender, System.EventArgs e)
+ {
+ var mainPage = CreateMainPage(true, _notTopOfScreenText);
+ var navPage = new NavigationPage(mainPage);
+ await Navigation.PushModalAsync(navPage);
+ }
+
+ async void NewNavigationPageTransparentPressed(System.Object sender, System.EventArgs e)
+ {
+ var mainPage = CreateMainPage(true, _notTopOfScreenText);
+ var navPage = new NavigationPage(mainPage)
+ {
+ BarBackgroundColor = Colors.Transparent,
+ };
+ await Navigation.PushModalAsync(navPage);
+ }
+
+ async void NewNavigationPageTranslucentPressed(System.Object sender, System.EventArgs e)
+ {
+ var mainPage = CreateMainPage(true, _notTopOfScreenText);
+ var navPage = new NavigationPage(mainPage);
+ navPage.On().EnableTranslucentNavigationBar();
+ await Navigation.PushModalAsync(navPage);
+ }
+
+ async void NewNavigationPageTransparentTranslucentPressed(System.Object sender, System.EventArgs e)
+ {
+ var mainPage = CreateMainPage(true, _notTopOfScreenText);
+ var navPage = new NavigationPage(mainPage)
+ {
+ BarBackgroundColor = Colors.Transparent,
+ };
+ navPage.On().EnableTranslucentNavigationBar();
+ await Navigation.PushModalAsync(navPage);
+ }
+
+ async void NewNavigationPageGridPressed(System.Object sender, System.EventArgs e)
+ {
+ var mainPage = CreateMainPage(false, _notTopOfScreenText);
+ var navPage = new NavigationPage(mainPage);
+ await Navigation.PushModalAsync(navPage);
+ }
+
+ async void NewNavigationPageGridTransparentPressed(System.Object sender, System.EventArgs e)
+ {
+ var mainPage = CreateMainPage(false, _notTopOfScreenText);
+ var navPage = new NavigationPage(mainPage)
+ {
+ BarBackgroundColor = Colors.Transparent,
+ };
+ await Navigation.PushModalAsync(navPage);
+ }
+
+ async void NewNavigationPageGridTranslucentPressed(System.Object sender, System.EventArgs e)
+ {
+ var mainPage = CreateMainPage(false, _notTopOfScreenText);
+ var navPage = new NavigationPage(mainPage);
+ navPage.On().EnableTranslucentNavigationBar();
+ await Navigation.PushModalAsync(navPage);
+ }
+
+ async void NewNavigationPageGridTransparentTranslucentPressed(System.Object sender, System.EventArgs e)
+ {
+ var mainPage = CreateMainPage(false, _topOfScreenText);
+ var navPage = new NavigationPage(mainPage)
+ {
+ BarBackgroundColor = Colors.Transparent,
+ };
+ navPage.On().EnableTranslucentNavigationBar();
+ await Navigation.PushModalAsync(navPage);
+ }
+
+ async void NewFlyoutPagePressed(System.Object sender, System.EventArgs e)
+ {
+ var detail = new NavigationPage(CreateMainPage(true, _notTopOfScreenText));
+ var flyoutPage = new FlyoutPage()
+ {
+ Flyout = new ContentPage(){Title = "FlyoutPage"},
+ Detail = detail
+ };
+ detail.BarBackgroundColor = Colors.Transparent;
+ detail.On().SetHideNavigationBarSeparator(true);
+ detail.On().EnableTranslucentNavigationBar();
+ await Navigation.PushModalAsync(flyoutPage);
+ }
+
+ async void NewFlyoutPageTransparentPressed(System.Object sender, System.EventArgs e)
+ {
+ var detail = new NavigationPage(CreateMainPage(true, _notTopOfScreenText));
+ var flyoutPage = new FlyoutPage()
+ {
+ Flyout = new ContentPage(){Title = "FlyoutPage"},
+ Detail = detail
+ };
+ detail.BarBackgroundColor = Colors.Transparent;
+ await Navigation.PushModalAsync(flyoutPage);
+ }
+
+ async void NewFlyoutPageTranslucentPressed(System.Object sender, System.EventArgs e)
+ {
+ var detail = new NavigationPage(CreateMainPage(true, _notTopOfScreenText));
+ var flyoutPage = new FlyoutPage()
+ {
+ Flyout = new ContentPage(){Title = "FlyoutPage"},
+ Detail = detail
+ };
+ detail.On().EnableTranslucentNavigationBar();
+ await Navigation.PushModalAsync(flyoutPage);
+ }
+
+ async void NewFlyoutPageTransparentTranslucentPressed(System.Object sender, System.EventArgs e)
+ {
+ var detail = new NavigationPage(CreateMainPage(true, _notTopOfScreenText));
+ var flyoutPage = new FlyoutPage()
+ {
+ Flyout = new ContentPage(){Title = "FlyoutPage"},
+ Detail = detail
+ };
+ detail.BarBackgroundColor = Colors.Transparent;
+ detail.On().EnableTranslucentNavigationBar();
+ await Navigation.PushModalAsync(flyoutPage);
+ }
+
+ async void NewFlyoutPageGridPressed(System.Object sender, System.EventArgs e)
+ {
+ var detail = new NavigationPage(CreateMainPage(false, _notTopOfScreenText));
+ var flyoutPage = new FlyoutPage()
+ {
+ Flyout = new ContentPage(){Title = "FlyoutPage"},
+ Detail = detail
+ };
+ await Navigation.PushModalAsync(flyoutPage);
+ }
+
+ async void NewFlyoutPageGridTransparentPressed(System.Object sender, System.EventArgs e)
+ {
+ var detail = new NavigationPage(CreateMainPage(false, _notTopOfScreenText));
+ var flyoutPage = new FlyoutPage()
+ {
+ Flyout = new ContentPage(){Title = "FlyoutPage"},
+ Detail = detail
+ };
+ detail.BarBackgroundColor = Colors.Transparent;
+ await Navigation.PushModalAsync(flyoutPage);
+ }
+
+ async void NewFlyoutPageGridTranslucentPressed(System.Object sender, System.EventArgs e)
+ {
+ var detail = new NavigationPage(CreateMainPage(false, _notTopOfScreenText));
+ var flyoutPage = new FlyoutPage()
+ {
+ Flyout = new ContentPage(){Title = "FlyoutPage"},
+ Detail = detail
+ };
+ detail.On().EnableTranslucentNavigationBar();
+ await Navigation.PushModalAsync(flyoutPage);
+ }
+ async void NewFlyoutPageGridTransparentTranslucentPressed(System.Object sender, System.EventArgs e)
+ {
+ var detail = new NavigationPage(CreateMainPage(false, _topOfScreenText));
+ var flyoutPage = new FlyoutPage()
+ {
+ Flyout = new ContentPage(){Title = "FlyoutPage"},
+ Detail = detail
+ };
+ detail.BarBackgroundColor = Colors.Transparent;
+ detail.On().EnableTranslucentNavigationBar();
+ await Navigation.PushModalAsync(flyoutPage);
+ }
+
+ async void SemiTransparentNavigationPageBackgroundColorPressed(System.Object sender, System.EventArgs e)
+ {
+ var mainPage = CreateMainPage(false, _topOfScreenText);
+ var navPage = new NavigationPage(mainPage)
+ {
+ BarBackgroundColor = Color.FromRgba(100, 100, 100, 50),
+ };
+ navPage.On().EnableTranslucentNavigationBar();
+ await Navigation.PushModalAsync(navPage);
+ }
+
+ async void SemiTransparentNavigationPageBrushPressed(System.Object sender, System.EventArgs e)
+ {
+ var mainPage = CreateMainPage(false, _topOfScreenText);
+ var navPage = new NavigationPage(mainPage)
+ {
+ BarBackground = Color.FromRgba(100, 100, 100, 50),
+ };
+ navPage.On().EnableTranslucentNavigationBar();
+ await Navigation.PushModalAsync(navPage);
+ }
+
+ async void SemiTransparentFlyoutPageBackgroundColorPressed(System.Object sender, System.EventArgs e)
+ {
+ var detail = new NavigationPage(CreateMainPage(false, _topOfScreenText));
+ var flyoutPage = new FlyoutPage()
+ {
+ Flyout = new ContentPage(){Title = "FlyoutPage"},
+ Detail = detail
+ };
+ detail.BarBackgroundColor = Color.FromRgba(100, 100, 100, 50);
+ detail.On().EnableTranslucentNavigationBar();
+ await Navigation.PushModalAsync(flyoutPage);
+ }
+
+ async void SemiTransparentFlyoutPageBrushPressed(System.Object sender, System.EventArgs e)
+ {
+ var detail = new NavigationPage(CreateMainPage(false, _topOfScreenText));
+ var flyoutPage = new FlyoutPage()
+ {
+ Flyout = new ContentPage(){Title = "FlyoutPage"},
+ Detail = detail
+ };
+ detail.BarBackground = Color.FromRgba(100, 100, 100, 50);
+ detail.On().EnableTranslucentNavigationBar();
+ await Navigation.PushModalAsync(flyoutPage);
+ }
+
+ ContentPage CreateMainPage (bool useSafeArea, string expectedText)
+ {
+ var mainPage = new ContentPage(){
+ AutomationId="PopupMainPage"
+ };
+ var grid = new Grid
+ {
+ RowDefinitions =
+ {
+ new RowDefinition { Height = new Microsoft.Maui.GridLength(1, Microsoft.Maui.GridUnitType.Star) },
+ new RowDefinition { Height = new Microsoft.Maui.GridLength(1, Microsoft.Maui.GridUnitType.Star) },
+ new RowDefinition { Height = new Microsoft.Maui.GridLength(1, Microsoft.Maui.GridUnitType.Star) },
+ },
+ };
+
+ var button = new Button { Text = "Pop Page", AutomationId="PopPageButton" };
+ button.Clicked += PopModalButtonClicked;
+
+ grid.Add (new BoxView { BackgroundColor = Colors.Green, AutomationId="TopBoxView" }, 0, 0 );
+ grid.Add (new Label { TextColor = Colors.Black, Margin= new Microsoft.Maui.Thickness(0,60,0,0), HorizontalTextAlignment = Microsoft.Maui.TextAlignment.Center, Text="Can you see me?" }, 0, 0 );
+ grid.Add (new Label { Text = expectedText }, 0, 1 );
+ grid.Add (button, 0, 2 );
+ grid.IgnoreSafeArea = true;
+
+ mainPage.Content = grid;
+ mainPage.On().SetUseSafeArea(useSafeArea);
+ return mainPage;
+ }
+
+ async void PopModalButtonClicked (System.Object sender, System.EventArgs e)
+ {
+ await Navigation.PopModalAsync();
+ }
+}
diff --git a/src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs
index 1cd68a14f0b9..61f6fece69ed 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs
@@ -21,6 +21,7 @@
using PointF = CoreGraphics.CGPoint;
using RectangleF = CoreGraphics.CGRect;
using SizeF = CoreGraphics.CGSize;
+using Microsoft.Maui.Platform;
namespace Microsoft.Maui.Controls.Handlers.Compatibility
{
@@ -676,26 +677,42 @@ void UpdateBackgroundColor()
void UpdateBarBackground()
{
var barBackgroundColor = NavPage.BarBackgroundColor;
+ var barBackgroundBrush = NavPage.BarBackground;
+
+ // if the brush has a solid color, treat it as a Color so we can compute the alpha value
+ if (NavPage.BarBackground is SolidColorBrush scb)
+ {
+ barBackgroundColor = scb.Color;
+ barBackgroundBrush = null;
+ }
if (OperatingSystem.IsIOSVersionAtLeast(13) || OperatingSystem.IsMacCatalystVersionAtLeast(13))
{
var navigationBarAppearance = NavigationBar.StandardAppearance;
-
- navigationBarAppearance.ConfigureWithOpaqueBackground();
-
- if (barBackgroundColor == null)
+ if (barBackgroundColor is null)
{
+ navigationBarAppearance.ConfigureWithOpaqueBackground();
navigationBarAppearance.BackgroundColor = Maui.Platform.ColorExtensions.BackgroundColor;
var parentingViewController = GetParentingViewController();
parentingViewController?.SetupDefaultNavigationBarAppearance();
}
else
+ {
+ if(barBackgroundColor?.Alpha < 1f)
+ navigationBarAppearance.ConfigureWithTransparentBackground();
+ else
+ navigationBarAppearance.ConfigureWithOpaqueBackground();
+
navigationBarAppearance.BackgroundColor = barBackgroundColor.ToPlatform();
+ }
+
+ if (barBackgroundBrush is not null)
+ {
+ var backgroundImage = NavigationBar.GetBackgroundImage(barBackgroundBrush);
- var barBackgroundBrush = NavPage.BarBackground;
- var backgroundImage = NavigationBar.GetBackgroundImage(barBackgroundBrush);
- navigationBarAppearance.BackgroundImage = backgroundImage;
+ navigationBarAppearance.BackgroundImage = backgroundImage;
+ }
NavigationBar.CompactAppearance = navigationBarAppearance;
NavigationBar.StandardAppearance = navigationBarAppearance;
@@ -703,14 +720,20 @@ void UpdateBarBackground()
}
else
{
- // Set navigation bar background color
- NavigationBar.BarTintColor = barBackgroundColor == null
- ? UINavigationBar.Appearance.BarTintColor
- : barBackgroundColor.ToPlatform();
+ if(barBackgroundColor?.Alpha == 0f)
+ {
+ NavigationBar.SetTransparentNavigationBar();
+ }
+ else
+ {
+ // Set navigation bar background color
+ NavigationBar.BarTintColor = barBackgroundColor == null
+ ? UINavigationBar.Appearance.BarTintColor
+ : barBackgroundColor.ToPlatform();
- var barBackgroundBrush = NavPage.BarBackground;
- var backgroundImage = NavigationBar.GetBackgroundImage(barBackgroundBrush);
- NavigationBar.SetBackgroundImage(backgroundImage, UIBarMetrics.Default);
+ var backgroundImage = NavigationBar.GetBackgroundImage(barBackgroundBrush);
+ NavigationBar.SetBackgroundImage(backgroundImage, UIBarMetrics.Default);
+ }
}
}
@@ -1152,24 +1175,19 @@ public void UpdateFrames()
!n._disposed &&
!n._navigating
)
- {
- nfloat offset = 0;
+ {
+ var vc = ChildViewControllers[^1];
- if (n._hasNavigationBar)
- offset = n.NavigationBar.Frame.Bottom;
+ if (vc is null)
+ return;
- if (!n._secondaryToolbar.Hidden)
- {
- offset += n._secondaryToolbar.Bounds.Height;
- }
+ var newAdditionalSafeArea = vc.AdditionalSafeAreaInsets;
+ var offset = n._secondaryToolbar.Hidden ? 0 : n._secondaryToolbar.Frame.Height;
- if (View.Frame.Y != offset)
+ if (newAdditionalSafeArea.Top != offset)
{
- var newY = offset - View.Frame.Y;
- var newHeight = View.Frame.Height - newY;
-
- View.Frame =
- new RectangleF(0, offset, View.Bounds.Width, newHeight);
+ newAdditionalSafeArea.Top = offset;
+ vc.AdditionalSafeAreaInsets = newAdditionalSafeArea;
}
}
}
diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellNavBarAppearanceTracker.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellNavBarAppearanceTracker.cs
index b167b308dc79..ad42e96a3718 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellNavBarAppearanceTracker.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellNavBarAppearanceTracker.cs
@@ -3,6 +3,7 @@
using System.ComponentModel;
using System.Runtime.Versioning;
using CoreGraphics;
+using Microsoft.Maui.Graphics;
using ObjCRuntime;
using UIKit;
@@ -42,8 +43,8 @@ public void SetAppearance(UINavigationController controller, ShellAppearance app
_defaultTitleAttributes = navBar.TitleTextAttributes;
}
- if (OperatingSystem.IsIOSVersionAtLeast(15) || OperatingSystem.IsTvOSVersionAtLeast(15))
- UpdateiOS15NavigationBarAppearance(controller, appearance);
+ if (OperatingSystem.IsIOSVersionAtLeast(13) || OperatingSystem.IsTvOSVersionAtLeast(13))
+ UpdateiOS13NavigationBarAppearance(controller, appearance);
else
UpdateNavigationBarAppearance(controller, appearance);
}
@@ -86,16 +87,25 @@ public virtual void SetHasShadow(UINavigationController controller, bool hasShad
#endregion
- [SupportedOSPlatform("ios15.0")]
- [SupportedOSPlatform("tvos15.0")]
- void UpdateiOS15NavigationBarAppearance(UINavigationController controller, ShellAppearance appearance)
+ [SupportedOSPlatform("ios13.0")]
+ [SupportedOSPlatform("tvos13.0")]
+ void UpdateiOS13NavigationBarAppearance(UINavigationController controller, ShellAppearance appearance)
{
var navBar = controller.NavigationBar;
var navigationBarAppearance = new UINavigationBarAppearance();
- navigationBarAppearance.ConfigureWithOpaqueBackground();
- navBar.Translucent = false;
+ // since we cannot set the Background Image directly, let's use the alpha in the background color to determine translucence
+ if (appearance.BackgroundColor?.Alpha < 1.0f)
+ {
+ navigationBarAppearance.ConfigureWithTransparentBackground();
+ navBar.Translucent = true;
+ }
+ else
+ {
+ navigationBarAppearance.ConfigureWithOpaqueBackground();
+ navBar.Translucent = false;
+ }
// Set ForegroundColor
var foreground = appearance.ForegroundColor;
@@ -126,10 +136,18 @@ void UpdateNavigationBarAppearance(UINavigationController controller, ShellAppea
var navBar = controller.NavigationBar;
- if (background != null)
+ if (appearance.BackgroundColor?.Alpha == 0f)
+ {
+ navBar.SetTransparentNavigationBar();
+ }
+ else
+ {
+ if (background != null)
navBar.BarTintColor = background.ToPlatform();
- if (foreground != null)
- navBar.TintColor = foreground.ToPlatform();
+ if (foreground != null)
+ navBar.TintColor = foreground.ToPlatform();
+ }
+
if (titleColor != null)
{
navBar.TitleTextAttributes = new UIStringAttributes
@@ -137,6 +155,9 @@ void UpdateNavigationBarAppearance(UINavigationController controller, ShellAppea
ForegroundColor = titleColor.ToPlatform()
};
}
+
+ // since we cannot set the Background Image directly, let's use the alpha in the background color to determine translucence
+ navBar.Translucent = appearance.BackgroundColor?.Alpha < 1.0f;
}
}
}
\ No newline at end of file
diff --git a/src/Controls/src/Core/Platform/iOS/Extensions/NavigationPageExtensions.cs b/src/Controls/src/Core/Platform/iOS/Extensions/NavigationPageExtensions.cs
index fc6b539c889e..a833c0ed1947 100644
--- a/src/Controls/src/Core/Platform/iOS/Extensions/NavigationPageExtensions.cs
+++ b/src/Controls/src/Core/Platform/iOS/Extensions/NavigationPageExtensions.cs
@@ -23,5 +23,13 @@ public static void UpdateIsNavigationBarTranslucent(this UINavigationController
platformView.NavigationBar.Translucent = navigationPage.OnThisPlatform().IsNavigationBarTranslucent();
}
+
+ internal static void SetTransparentNavigationBar (this UINavigationBar navigationBar)
+ {
+ navigationBar.SetBackgroundImage(new UIImage(), UIBarMetrics.Default);
+ navigationBar.ShadowImage = new UIImage();
+ navigationBar.BackgroundColor = UIColor.Clear;
+ navigationBar.BarTintColor = UIColor.Clear;
+ }
}
}
\ No newline at end of file
diff --git a/src/Controls/tests/UITests/Tests/Issues/Issue17022.cs b/src/Controls/tests/UITests/Tests/Issues/Issue17022.cs
new file mode 100644
index 000000000000..cea3d36685e1
--- /dev/null
+++ b/src/Controls/tests/UITests/Tests/Issues/Issue17022.cs
@@ -0,0 +1,62 @@
+using NUnit.Framework;
+using UITest.Appium;
+using UITest.Core;
+
+namespace Microsoft.Maui.AppiumTests.Issues
+{
+ public class Issue17022 : _IssuesUITest
+ {
+ public Issue17022(TestDevice device)
+ : base(device)
+ { }
+
+ public override string Issue => "UINavigationBar is Translucent";
+
+ // TODO: Add shell navigation bar tests when we can call shell in UITest
+ [Test]
+ [TestCase("NewNavigationPageButton", false)]
+ [TestCase("NewNavigationPageTransparentButton", false)]
+ [TestCase("NewNavigationPageTranslucentButton", false)]
+ [TestCase("NewNavigationPageTransparentTranslucentButton", false)]
+ [TestCase("NewNavigationPageGridButton", false)]
+ [TestCase("NewNavigationPageGridTransparentButton", false)]
+ [TestCase("NewNavigationPageGridTranslucentButton", false, true)] // this test thinks the boxview is at the top of the screen, but it's not. Test this case manually for now.
+ [TestCase("NewNavigationPageGridTransparentTranslucentButton", true)]
+ [TestCase("NewFlyoutPageButton", false)]
+ [TestCase("NewFlyoutPageTransparentButton", false)]
+ [TestCase("NewFlyoutPageTranslucentButton", false)]
+ [TestCase("NewFlyoutPageTransparentTranslucentButton", false)]
+ [TestCase("NewFlyoutPageGridButton", false)]
+ [TestCase("NewFlyoutPageGridTransparentButton", false)]
+ [TestCase("NewFlyoutPageGridTranslucentButton", false, true)] // this test thinks the boxview is at the top of the screen, but it's not. Test this case manually for now.
+ [TestCase("NewFlyoutPageGridTransparentTranslucentButton", true)]
+ [TestCase("SemiTransparentNavigationPageBackgroundColor", true, true)]
+ [TestCase("SemiTransparentNavigationPageBrush", true, true)]
+ [TestCase("SemiTransparentFlyoutPageBackgroundColor", true, true)]
+ [TestCase("SemiTransparentFlyoutPageBrush", true, true)]
+
+ public void Issue17022Test(string testButtonID, bool isTopOfScreen, bool requiresScreenshot = false)
+ {
+ this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Mac, TestDevice.Windows }, "This test is only for iOS");
+
+ App.WaitForElement(testButtonID).Click();
+ var boxView = App.WaitForElement("TopBoxView");
+ Assert.NotNull(boxView);
+ var rect = boxView.GetRect();
+
+ if (requiresScreenshot)
+ {
+ VerifyScreenshot(TestContext.CurrentContext.Test.MethodName + testButtonID);
+ }
+ else
+ {
+ if (isTopOfScreen)
+ Assert.AreEqual(rect.Y, 0);
+ else
+ Assert.AreNotEqual(rect.Y, 0);
+ }
+
+ App.WaitForElement("PopPageButton").Click();
+ }
+ }
+}
diff --git a/src/Controls/tests/UITests/snapshots/ios/Issue17022TestNewFlyoutPageGridTranslucentButton.png b/src/Controls/tests/UITests/snapshots/ios/Issue17022TestNewFlyoutPageGridTranslucentButton.png
new file mode 100644
index 000000000000..c42d666da7db
Binary files /dev/null and b/src/Controls/tests/UITests/snapshots/ios/Issue17022TestNewFlyoutPageGridTranslucentButton.png differ
diff --git a/src/Controls/tests/UITests/snapshots/ios/Issue17022TestNewNavigationPageGridTranslucentButton.png b/src/Controls/tests/UITests/snapshots/ios/Issue17022TestNewNavigationPageGridTranslucentButton.png
new file mode 100644
index 000000000000..5f12f247d49d
Binary files /dev/null and b/src/Controls/tests/UITests/snapshots/ios/Issue17022TestNewNavigationPageGridTranslucentButton.png differ
diff --git a/src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentFlyoutPageBackgroundColor.png b/src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentFlyoutPageBackgroundColor.png
new file mode 100644
index 000000000000..a6d275546a87
Binary files /dev/null and b/src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentFlyoutPageBackgroundColor.png differ
diff --git a/src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentFlyoutPageBrush.png b/src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentFlyoutPageBrush.png
new file mode 100644
index 000000000000..dc480d307c66
Binary files /dev/null and b/src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentFlyoutPageBrush.png differ
diff --git a/src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentNavigationPageBackgroundColor.png b/src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentNavigationPageBackgroundColor.png
new file mode 100644
index 000000000000..ccca884e8c0c
Binary files /dev/null and b/src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentNavigationPageBackgroundColor.png differ
diff --git a/src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentNavigationPageBrush.png b/src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentNavigationPageBrush.png
new file mode 100644
index 000000000000..db721282f40f
Binary files /dev/null and b/src/Controls/tests/UITests/snapshots/ios/Issue17022TestSemiTransparentNavigationPageBrush.png differ