Hi
I am trying to create a view using SearchBar in a view using code. But I am not able see it on the screen and it breaks.
Can anybody help me with this.
This is the one I am using.
SearchBar searchBar = new SearchBar();
searchBar.Placeholder = "search";
searchBar.BackgroundColor = Color.White;
searchBar.HorizontalOptions = LayoutOptions.CenterAndExpand;
searchBar.WidthRequest = 300;
searchBar.VerticalOptions = LayoutOptions.CenterAndExpand;
searchBar.IsVisible = true;
layout.Children.Add(searchBar);
Content = layout;
Thanks