This repository was archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS] Specify a default size for UISearchBar width if needed (#3635) f…
…ixes #3413 fixes #2139 * [Controls] Add reproduction and test case for issue #3413 * [iOS] Don't use max value for iOS UISearchbar breaks on iOS 11.3 * [iOS] Force width value so we can renderer UISearchBar on iOS10 with infinite width * [Controls] Fix spelling and add Manual Review to the test of #3413 * [iOS] Simplify code for UISearchBar width * [iOS] Return always some width from measure the UISearchBar on IOS * [Controls] Add reproduction case for issue #2139
- Loading branch information
Showing
3 changed files
with
92 additions
and
5 deletions.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue3413.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 3413, "[iOS] Searchbar in Horizontal Stacklayout doesn't render", PlatformAffected.iOS)] | ||
public class Issue3413 : TestContentPage | ||
{ | ||
protected override void Init() | ||
{ | ||
Padding = new Thickness(20); | ||
|
||
var layout = new StackLayout | ||
{ | ||
Orientation = StackOrientation.Vertical | ||
}; | ||
|
||
var searchBar = new SearchBar | ||
{ | ||
BackgroundColor = Color.Yellow, | ||
Text = "i m on a vertical stacklayout", | ||
AutomationId = "srb_vertical" | ||
}; | ||
layout.Children.Add(new Label { Text = "Vertical" }); | ||
layout.Children.Add(searchBar); | ||
|
||
var layout1 = new StackLayout | ||
{ | ||
Orientation = StackOrientation.Horizontal | ||
}; | ||
|
||
var searchBar1 = new SearchBar | ||
{ | ||
BackgroundColor = Color.Yellow, | ||
Text = "i m on a horizontal stacklayout", | ||
AutomationId = "srb_horizontal" | ||
}; | ||
|
||
layout1.Children.Add(new Label { Text = "Horizontal" }); | ||
layout1.Children.Add(searchBar1); | ||
|
||
var searchBar2 = new SearchBar | ||
{ | ||
BackgroundColor = Color.Blue, | ||
Text = "i m with expand", | ||
HorizontalOptions = LayoutOptions.CenterAndExpand, | ||
AutomationId = "srb_grid" | ||
}; | ||
|
||
var grid = new Grid(); | ||
grid.Children.Add(layout); | ||
Grid.SetRow(layout, 0); | ||
grid.Children.Add(layout1); | ||
Grid.SetRow(layout1, 1); | ||
grid.Children.Add(searchBar2); | ||
Grid.SetRow(searchBar2, 2); | ||
Content = grid; | ||
} | ||
|
||
#if UITEST | ||
[Test] | ||
[Category(UITestCategories.ManualReview)] | ||
public void Issue3413Test () | ||
{ | ||
RunningApp.WaitForElement (q => q.Marked ("srb_vertical")); | ||
RunningApp.WaitForElement (q => q.Marked ("srb_horizontal")); | ||
RunningApp.Screenshot ("Please verify we have 2 SearchBars. One below the label, other side by side with the label"); | ||
} | ||
#endif | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters