diff options
author | Paul DiPietro <paul.dipietro@me.com> | 2016-04-12 11:15:21 -0700 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-04-12 11:15:21 -0700 |
commit | 76c8c57fb30621272e19d493787836ed8c322b9d (patch) | |
tree | 4052edc8d289daf5f9982948f02f0a4d17fd349a /Xamarin.Forms.Controls.Issues | |
parent | c92297047c01112fd4a6e7695a40acb274fdf7a7 (diff) | |
download | xamarin-forms-76c8c57fb30621272e19d493787836ed8c322b9d.tar.gz xamarin-forms-76c8c57fb30621272e19d493787836ed8c322b9d.tar.bz2 xamarin-forms-76c8c57fb30621272e19d493787836ed8c322b9d.zip |
[UWP] Adjust bounds for ContentPage when by itself (#61)
In a scenario where there is a ContentPage by itself, things like labels
ran beneath the StatusBar in landscape mode. This is presumably because
the page was assuming there to be a TitleBar and calculating the bounds
based on that fact; by checking for its visibility and adjusting the
bounds as necessary it allows for correct alignment.
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
2 files changed, 48 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40185.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40185.cs new file mode 100644 index 00000000..d6f17d9d --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40185.cs @@ -0,0 +1,47 @@ +using System; + +using Xamarin.Forms.CustomAttributes; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 40185, "[UWP] ContentPage does not have proper right bounds in landscape", PlatformAffected.WinRT)] + public class Bugzilla40185 : TestContentPage + { + protected override void Init() + { + Content = new StackLayout + { + VerticalOptions = LayoutOptions.Center, + Children = + { + new Button + { + Text = "Switch Main Page", + Command = new Command(SwitchMainPage) + } + } + }; + } + + void SwitchMainPage() + { + Application.Current.MainPage = new ContentPage + { + BackgroundColor = Color.White, + Content = new Label + { + Text = "This text should be in bounds in landscape mode.", + HorizontalTextAlignment = TextAlignment.End, + VerticalTextAlignment = TextAlignment.Center, + TextColor = Color.Black + } + }; + } + } +} diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems index c8874940..ca43a273 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems @@ -97,6 +97,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla39702.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla40173.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla39821.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Bugzilla40185.cs" /> <Compile Include="$(MSBuildThisFileDirectory)CarouselAsync.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla34561.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla34727.cs" /> |