public void Issue773TestsRotationRelayoutIssue () { RunningApp.SetOrientationLandscape (); var buttonLabels = new [] { "Button 1", "Button 2", "Button 3", }; foreach (string buttonLabel in buttonLabels) RunningApp.WaitForElement (q => q.Button (buttonLabel)); RunningApp.Screenshot ("StackLayout in Modal respects rotation"); RunningApp.SetOrientationPortrait (); }
public ListViewTest () { Title = "List Page"; var items = new[] { new TabbedPageWithListName () { Name = "Jason" }, new TabbedPageWithListName () { Name = "Ermau" }, new TabbedPageWithListName () { Name = "Seth" } }; var cellTemplate = new DataTemplate (typeof(TextCell)); cellTemplate.SetBinding (TextCell.TextProperty, "Name"); Content = new ListView () { ItemTemplate = cellTemplate, ItemsSource = items }; }
protected override void Init() { var outputLabel = new Label(); var testButton = new Button { Text = "Can't Touch This", AutomationId = CantTouchButtonId }; testButton.Clicked += (sender, args) => outputLabel.Text = CantTouchFailText; var testGrid = new Grid { Children = { testButton, new BoxView { Color = Color.Pink.MultiplyAlpha(0.5) } } }; // BoxView over Button prevents Button click var testButtonOk = new Button { Text = "Can Touch This", AutomationId = CanTouchButtonId }; testButtonOk.Clicked += (sender, args) => outputLabel.Text = CanTouchSuccessText; var testGridOk = new Grid { Children = { testButtonOk, new BoxView { Color = Color.Pink.MultiplyAlpha(0.5), InputTransparent = true } } }; var testListView = new ListView(); var items = new[] { "Foo" }; testListView.ItemsSource = items; testListView.ItemTemplate = new DataTemplate(() => { var result = new ViewCell { View = new Grid { Children = { new BoxView { AutomationId = ListTapTarget, Color = Color.Pink.MultiplyAlpha(0.5) } } } }; return result; }); testListView.ItemSelected += (sender, args) => outputLabel.Text = ListTapSuccessText; Content = new StackLayout { Children = { outputLabel, testGrid, testGridOk, testListView } }; }