-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Issue1323.cs
57 lines (50 loc) · 1.69 KB
/
Issue1323.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
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github5000)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 1323, "tabbed page BarTextColor is not pervasive and can't be applied after instantiation", PlatformAffected.iOS)]
public class Issue1323 : TestTabbedPage // or TestMasterDetailPage, etc ...
{
protected override void Init()
{
BarBackgroundColor = Color.FromHex("#61a60e");
BarTextColor = Color.FromHex("#ffffff");
BackgroundColor = Color.FromHex("#61a60e");
var page = new ContentPage { Title = "Page 1", Content = new Button { Text = "Pop", Command = new Command(async () => await Navigation.PopModalAsync()) } };
var page2 = new ContentPage { Title = "Page 2" };
var page3 = new ContentPage { Title = "Page 3" };
var page4 = new ContentPage { Title = "Page 4" };
Children.Add(page);
Children.Add(page2);
Children.Add(page3);
Children.Add(page4);
}
protected override void OnAppearing()
{
base.OnAppearing();
BarTextColor = Color.White;
Children.RemoveAt(1);
Children.Insert(1, new ContentPage { Title = "Page5", IconImageSource = "Loyalty.png" });
Children.RemoveAt(3);
Children.Insert(2, new ContentPage { Title = "Page6", IconImageSource = "Gift.png" });
BarTextColor = Color.White;
}
#if UITEST
[Test]
public void Issue1323Test()
{
RunningApp.WaitForElement(X => X.Marked("Page 1"));
RunningApp.WaitForElement(X => X.Marked("Page5"));
RunningApp.Screenshot("All tab bar items text should be white");
}
#endif
}
}