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.
[iOS] Fix ScaledScreenSize values using Face Up device orientation (#…
…13163) * Added repro sample * Fix the issue Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>
- Loading branch information
1 parent
3620bea
commit 9c0131f
Showing
3 changed files
with
79 additions
and
7 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue11980.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,60 @@ | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
#if UITEST | ||
using Xamarin.Forms.Core.UITests; | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
#if UITEST | ||
[Category(UITestCategories.ManualReview)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 11980, "[iOS] ScaledScreenSize Height return wrong value when the Device Orientation is Faceup", | ||
PlatformAffected.iOS)] | ||
public class Issue11980 : TestContentPage | ||
{ | ||
public Issue11980() | ||
{ | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
Title = "Issue 11980"; | ||
|
||
var layout = new StackLayout(); | ||
|
||
var instructions = new Label | ||
{ | ||
Padding = 12, | ||
BackgroundColor = Color.Black, | ||
TextColor = Color.White, | ||
Text = "Using Face Up DeviceOrientation, tap the button. If the width and height values are different, the test has passed." | ||
}; | ||
|
||
var button = new Button | ||
{ | ||
Text = "Get ScaledScreenSize" | ||
}; | ||
|
||
var heightLabel = new Label(); | ||
var widthLabel = new Label(); | ||
|
||
layout.Children.Add(instructions); | ||
layout.Children.Add(button); | ||
layout.Children.Add(heightLabel); | ||
layout.Children.Add(widthLabel); | ||
|
||
Content = layout; | ||
|
||
button.Clicked += (sender, args) => | ||
{ | ||
heightLabel.Text = $"Height {Device.Info.ScaledScreenSize.Height}"; | ||
widthLabel.Text = $"Width {Device.Info.ScaledScreenSize.Width}"; | ||
}; | ||
} | ||
} | ||
} |
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