generated from unoplatform/template
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Ensure iOS NavigationBar renders when inside of AutoLayout
- Loading branch information
Showing
10 changed files
with
239 additions
and
47 deletions.
There are no files selected for viewing
54 changes: 23 additions & 31 deletions
54
...o.Toolkit.Samples.Shared/Content/NestedSamples/M3MaterialNavigationBarSample_Primary.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,52 @@ | ||
<Page x:Class="Uno.Toolkit.Samples.Content.NestedSamples.M3MaterialNavigationBarSample_Primary" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="using:Uno.Toolkit.Samples.Content.NestedSamples" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:utu="using:Uno.Toolkit.UI" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" | ||
mc:Ignorable="d"> | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="using:Uno.Toolkit.Samples.Content.NestedSamples" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:utu="using:Uno.Toolkit.UI" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" | ||
mc:Ignorable="d"> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
<utu:AutoLayout> | ||
<!--<StackPanel>--> | ||
<utu:NavigationBar AutomationProperties.AutomationId="M3Page1PrimaryNavBar" | ||
Content="Page Title" | ||
MainCommandMode="Action" | ||
Style="{StaticResource MaterialPrimaryNavigationBarStyle}"> | ||
Content="Page Title" | ||
MainCommandMode="Action" | ||
Style="{StaticResource MaterialPrimaryNavigationBarStyle}"> | ||
<utu:NavigationBar.MainCommand> | ||
<AppBarButton AutomationProperties.AutomationId="M3_Primary_NavBar_Close_Button" | ||
Click="NavigateBack" | ||
Label="Close"> | ||
Click="NavigateBack" | ||
Label="Close"> | ||
<AppBarButton.Icon> | ||
<BitmapIcon UriSource="ms-appx:///Assets/CloseIcon.png" /> | ||
</AppBarButton.Icon> | ||
</AppBarButton> | ||
</utu:NavigationBar.MainCommand> | ||
<utu:NavigationBar.PrimaryCommands> | ||
<AppBarButton Label="More" | ||
Style="{StaticResource MaterialPrimaryAppBarButtonStyle}"> | ||
Style="{StaticResource MaterialPrimaryAppBarButtonStyle}"> | ||
<AppBarButton.Icon> | ||
<BitmapIcon UriSource="ms-appx:///Assets/MaterialIcon_Small.png" /> | ||
</AppBarButton.Icon> | ||
</AppBarButton> | ||
<AppBarButton Label="More" | ||
Style="{StaticResource MaterialPrimaryAppBarButtonStyle}"> | ||
Style="{StaticResource MaterialPrimaryAppBarButtonStyle}"> | ||
<AppBarButton.Icon> | ||
<BitmapIcon UriSource="ms-appx:///Assets/AppleIcon_Small.png" /> | ||
</AppBarButton.Icon> | ||
</AppBarButton> | ||
</utu:NavigationBar.PrimaryCommands> | ||
<utu:NavigationBar.SecondaryCommands> | ||
<AppBarButton Label="More" | ||
Style="{StaticResource MaterialPrimaryAppBarButtonStyle}" /> | ||
Style="{StaticResource MaterialPrimaryAppBarButtonStyle}" /> | ||
<AppBarButton Label="More" | ||
Style="{StaticResource MaterialPrimaryAppBarButtonStyle}" /> | ||
Style="{StaticResource MaterialPrimaryAppBarButtonStyle}" /> | ||
<AppBarButton Label="More" | ||
Style="{StaticResource MaterialPrimaryAppBarButtonStyle}" /> | ||
Style="{StaticResource MaterialPrimaryAppBarButtonStyle}" /> | ||
</utu:NavigationBar.SecondaryCommands> | ||
</utu:NavigationBar> | ||
<StackPanel Grid.Row="1" | ||
Padding="16,0" | ||
VerticalAlignment="Center" | ||
Spacing="8"> | ||
<Button Click="NavigateBack" | ||
Content="Exit sample" /> | ||
</StackPanel> | ||
</Grid> | ||
<Button Margin="100" Content="Back" Click="NavigateBack" /> | ||
<!--</StackPanel>--> | ||
</utu:AutoLayout> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/Uno.Toolkit.RuntimeTests/Tests/TestPages/NavBarAutoLayoutPage.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Page | ||
x:Class="Uno.Toolkit.RuntimeTests.Tests.TestPages.NavBarAutoLayoutPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Uno.Toolkit.RuntimeTests.Tests.TestPages" | ||
xmlns:utu="using:Uno.Toolkit.UI" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
<utu:AutoLayout> | ||
<utu:NavigationBar Content="Testing" /> | ||
</utu:AutoLayout> | ||
</Page> |
39 changes: 39 additions & 0 deletions
39
src/Uno.Toolkit.RuntimeTests/Tests/TestPages/NavBarAutoLayoutPage.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Uno.Toolkit.UI; | ||
|
||
#if IS_WINUI | ||
using Microsoft.UI; | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
using Microsoft.UI.Xaml.Controls.Primitives; | ||
using Microsoft.UI.Xaml.Data; | ||
using Microsoft.UI.Xaml.Input; | ||
using Microsoft.UI.Xaml.Media; | ||
using Microsoft.UI.Xaml.Navigation; | ||
#else | ||
using Windows.UI; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
#endif | ||
|
||
namespace Uno.Toolkit.RuntimeTests.Tests.TestPages | ||
{ | ||
public sealed partial class NavBarAutoLayoutPage : Page | ||
{ | ||
public NavBarAutoLayoutPage() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/Uno.Toolkit.RuntimeTests/Tests/TestPages/NavBarSimplePage.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Page x:Class="Uno.Toolkit.RuntimeTests.Tests.TestPages.NavBarSimplePage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Uno.Toolkit.RuntimeTests.Tests.TestPages" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:utu="using:Uno.Toolkit.UI" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
<utu:NavigationBar Content="Testing" /> | ||
</Page> |
30 changes: 30 additions & 0 deletions
30
src/Uno.Toolkit.RuntimeTests/Tests/TestPages/NavBarSimplePage.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
using Microsoft.UI.Xaml.Controls.Primitives; | ||
using Microsoft.UI.Xaml.Data; | ||
using Microsoft.UI.Xaml.Input; | ||
using Microsoft.UI.Xaml.Media; | ||
using Microsoft.UI.Xaml.Navigation; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
|
||
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 | ||
|
||
namespace Uno.Toolkit.RuntimeTests.Tests.TestPages | ||
{ | ||
/// <summary> | ||
/// An empty page that can be used on its own or navigated to within a Frame. | ||
/// </summary> | ||
public sealed partial class NavBarSimplePage : Page | ||
{ | ||
public NavBarSimplePage() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters