2016-03-22 23:02:25 +03:00
|
|
|
|
using System;
|
|
|
|
|
using Xamarin.Forms;
|
|
|
|
|
using Xamarin.Forms.CustomAttributes;
|
2016-04-26 18:20:55 +03:00
|
|
|
|
using Xamarin.Forms.Internals;
|
2016-03-22 23:02:25 +03:00
|
|
|
|
|
|
|
|
|
#if UITEST
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using Xamarin.UITest;
|
|
|
|
|
#endif
|
|
|
|
|
|
2016-11-17 00:07:30 +03:00
|
|
|
|
namespace Xamarin.Forms.Controls.Issues
|
2016-03-22 23:02:25 +03:00
|
|
|
|
{
|
|
|
|
|
[Preserve (AllMembers = true)]
|
|
|
|
|
[Issue (IssueTracker.Github, 2222, "NavigationBar.ToolbarItems.Add() crashes / breaks app in iOS7. works fine in iOS8", PlatformAffected.iOS)]
|
|
|
|
|
public class Issue2222 : TestNavigationPage
|
|
|
|
|
{
|
|
|
|
|
protected override void Init ()
|
|
|
|
|
{
|
|
|
|
|
var tbItem = new ToolbarItem { Text = "hello", Icon="wrongName" };
|
|
|
|
|
ToolbarItems.Add(tbItem);
|
|
|
|
|
|
|
|
|
|
PushAsync (new Issue22221 ());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Preserve (AllMembers = true)]
|
|
|
|
|
public class Issue22221 : ContentPage
|
|
|
|
|
{
|
|
|
|
|
public Issue22221 ()
|
|
|
|
|
{
|
|
|
|
|
Content = new StackLayout {
|
|
|
|
|
Children = {
|
|
|
|
|
new Label { Text = "Hello Toolbaritem" }
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if UITEST
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestItDoesntCrashWithWrongIconName ()
|
|
|
|
|
{
|
|
|
|
|
RunningApp.WaitForElement(c=>c.Marked("Hello Toolbaritem"));
|
|
|
|
|
RunningApp.Screenshot ("Was label on page shown");
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|