This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Rui Marinho <me@ruimarinho.net>
- Loading branch information
1 parent
16107f9
commit 8823018
Showing
3 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10578.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,13 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<NavigationPage | ||
xmlns="http://xamarin.com/schemas/2014/forms" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:d="http://xamarin.com/schemas/2014/forms/design" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core" | ||
mc:Ignorable="d" | ||
Title="Test 12912" | ||
x:Class="Xamarin.Forms.Controls.Issues.Issue10578" | ||
BarBackgroundColor="CornSilk" | ||
ios:NavigationPage.HideNavigationBarSeparator="True"> | ||
</NavigationPage> |
83 changes: 83 additions & 0 deletions
83
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10578.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,83 @@ | ||
using System; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
using Xamarin.Forms.PlatformConfiguration; | ||
using Xamarin.Forms.PlatformConfiguration.iOSSpecific; | ||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 10578, | ||
"[Bug][iOS] NavigationPage.HideNavigationBarSeparator=true doesn't work from XAML", | ||
PlatformAffected.iOS)] | ||
public partial class Issue10578 : NavigationPage | ||
{ | ||
public Issue10578() | ||
{ | ||
#if APP | ||
InitializeComponent(); | ||
PushAsync(new Issue10578Instructions(this)); | ||
#endif | ||
} | ||
} | ||
|
||
[Preserve(AllMembers = true)] | ||
public class Issue10578Instructions : ContentPage | ||
{ | ||
NavigationPage _navigationPage; | ||
|
||
public Issue10578Instructions(NavigationPage navigationPage) | ||
{ | ||
_navigationPage = navigationPage; | ||
|
||
Title = "Issue 10578"; | ||
|
||
var layout = new StackLayout(); | ||
|
||
var instructions = new Label | ||
{ | ||
Padding = 12, | ||
Margin = 12, | ||
BackgroundColor = Color.Black, | ||
TextColor = Color.White, | ||
Text = "If the NavigationBar Separator is hidden, the test has passed." | ||
}; | ||
|
||
var showButton = new Button | ||
{ | ||
Text = "Show separator" | ||
}; | ||
|
||
showButton.Clicked += OnShowButtonClicked; | ||
|
||
var hideButton = new Button | ||
{ | ||
Text = "Hide separator" | ||
}; | ||
|
||
hideButton.Clicked += OnHideButtonClicked; | ||
|
||
layout.Children.Add(instructions); | ||
layout.Children.Add(showButton); | ||
layout.Children.Add(hideButton); | ||
|
||
Content = layout; | ||
} | ||
|
||
void OnHideButtonClicked(object sender, EventArgs e) | ||
{ | ||
_navigationPage.On<iOS>().SetHideNavigationBarSeparator(true); | ||
} | ||
|
||
void OnShowButtonClicked(object sender, EventArgs e) | ||
{ | ||
_navigationPage.On<iOS>().SetHideNavigationBarSeparator(false); | ||
} | ||
} | ||
} |
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