Afin de surmonter cela dans Xamarin Forms, vous devrez créer un CustomRenderer
dans la classe SearchBar
Comme ça:
using System;
using Xamarin.Forms.Platform.iOS;
using Xamarin.Forms;
using MyProject.iOS;
[assembly: ExportRenderer(typeof(SearchBar), typeof(CustomSearchBarRenderer))]
namespace MyProject.iOS
{
public class CustomSearchBarRenderer:SearchBarRenderer
{
protected override void OnElementChanged (ElementChangedEventArgs<Xamarin.Forms.SearchBar> e)
{
base.OnElementChanged (e);
if (this.Control == null) return;
this.Control.BackgroundImage = new UIKit.UIImage ();
}
}
}