-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Bugzilla45723.cs
50 lines (47 loc) · 1.87 KB
/
Bugzilla45723.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
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[NUnit.Framework.Category(Core.UITests.UITestCategories.Bugzilla)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 45723, "Entry / Editor and a Button. Tapping the button dismisses the keyboard", PlatformAffected.iOS)]
public class Bugzilla45723 : TestNavigationPage // or TestMasterDetailPage, etc ...
{
protected override void Init()
{
PushAsync(new EditorAndButtonReproPage());
}
}
public class EditorAndButtonReproPage : ContentPage
{
public EditorAndButtonReproPage()
{
BackgroundColor = Color.Gray;
Padding = 50;
var editor = new Editor { HorizontalOptions = LayoutOptions.FillAndExpand };
var editorButton = new Button { Text = "OK", HorizontalOptions = LayoutOptions.End };
editorButton.On<iOS>().SetCanBecomeFirstResponder(true);
var editorLayout = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { editor, editorButton }, VerticalOptions = LayoutOptions.Start };
var endtry = new Entry { Placeholder = "Entry", HorizontalOptions = LayoutOptions.FillAndExpand };
var entryButton = new Button { Text = "OK", HorizontalOptions = LayoutOptions.End };
var entryLayout = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { endtry, entryButton }, VerticalOptions = LayoutOptions.Start };
Content = new StackLayout
{
Children = {
new Label() { Text = "Click editor to make keyboard appear. Click ok and keyboard shouldn't disappear"},
editorLayout,
new Label() { Text = "Click entry to make keyboard appear. Click ok and keyboard should disappear"},
entryLayout
}
};
}
}
}