protected override void OnAttached() { var searchbar = Control as UISearchBar; if (searchbar != null) { oldstyle = searchbar.SearchBarStyle; searchbar.BarStyle = UIBarStyle.Default; searchbar.BackgroundImage = new UIImage(); Foundation.NSString _searchField = new Foundation.NSString("searchField"); var textFieldInsideSearchBar = (UITextField)searchbar.ValueForKey(_searchField); textFieldInsideSearchBar.BackgroundColor = UIColor.FromRGB(220, 220, 220); } }
/// <include file="../../../../docs/Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific/SearchBar.xml" path="//Member[@MemberName='SetSearchBarStyle']/Docs" /> public static IPlatformElementConfiguration <iOS, FormsElement> SetSearchBarStyle( this IPlatformElementConfiguration <iOS, FormsElement> config, UISearchBarStyle style) { SetSearchBarStyle(config.Element, style); return(config); }
/// <include file="../../../../docs/Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific/SearchBar.xml" path="//Member[@MemberName='SetSearchBarStyle'][0]/Docs" /> public static void SetSearchBarStyle(BindableObject element, UISearchBarStyle style) { element.SetValue(SearchBarStyleProperty, style); }