-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Issue1396.cs
61 lines (53 loc) · 1.37 KB
/
Issue1396.cs
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
54
55
56
57
58
59
60
61
using System;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github5000)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 1396,
"Label TextAlignment is not kept when resuming application",
PlatformAffected.Android)]
public class Issue1396 : TestContentPage
{
Label _label;
protected override void Init()
{
var instructions = new Label
{
Text = "Tap the 'Change Text' button. Tap the Overview button. Resume the application. If the label"
+ " text is no longer centered, the test has failed."
};
var button = new Button { Text = "Change Text" };
button.Clicked += (sender, args) =>
{
_label.Text = DateTime.Now.ToString("F");
};
_label = new Label
{
HeightRequest = 400,
BackgroundColor = Color.Gold,
Text = "I should be centered in the gold area",
VerticalTextAlignment = TextAlignment.Center,
HorizontalTextAlignment = TextAlignment.Center
};
var layout = new StackLayout
{
Children =
{
instructions,
button,
_label
}
};
var content = new ContentPage
{
Content = layout
};
Content = new Label { Text = "Shouldn't see this" };
Appearing += (sender, args) => Application.Current.MainPage = content;
}
}
}