summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue968.cs
blob: 9d85420eb735a444942a683181dd6dab03f7dbac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

#if UITEST
using NUnit.Framework;
using Xamarin.UITest;
#endif

namespace Xamarin.Forms.Controls
{
	[Preserve (AllMembers = true)]
	[Issue (IssueTracker.Github, 968, "StackLayout does not relayout on device rotation", PlatformAffected.iOS, NavigationBehavior.PushModalAsync)]
	public class Issue968 : TestContentPage
	{
		protected override void Init ()
		{
			Title = "Nav Bar";

			var layout = new StackLayout {
				Padding = new Thickness (20),
				BackgroundColor = Color.Gray
			};

			layout.Children.Add (new BoxView {
				BackgroundColor = Color.Red,
				VerticalOptions = LayoutOptions.FillAndExpand,
				HorizontalOptions = LayoutOptions.FillAndExpand
			});

			layout.Children.Add (new Label {
				Text = "You should see me after rotating"
			});

			Content = layout;
		}

#if UITEST
		[Test]
		[Description ("Verify the layout lays out on rotations")]
		[UiTest (typeof(StackLayout))]
		public void Issue968TestsRotationRelayoutIssue ()
		{
			RunningApp.SetOrientationLandscape ();
			RunningApp.Screenshot ("Rotated to Landscape");
			RunningApp.WaitForElement (q => q.Marked ("You should see me after rotating"));
			RunningApp.Screenshot ("StackLayout in Modal respects rotation");
			RunningApp.SetOrientationPortrait ();
		}
#endif

	}
}