We are using visual material picker control in our app. If I select anything from the picker popup title shows the top and selected value below. If I click cancel from the picker popup title also shows top. It should be in the default state. How to resolve this xamarin forms android and ios?
internal class CustomMaterialPickerRenderer : MaterialPickerRenderer {
}
If I understand correctly , do you want to make the title back to the default position when clicking on the cancel button ?
I test both on iOS and Android , the problem only occurs on Android side .
[assembly: ExportRenderer(typeof(Picker), typeof(MyRenderer), new[] { typeof(VisualMarker.MaterialVisual) })]
namespace FormsApp.Droid
{
class MyRenderer : MaterialPickerRenderer
{
Context _context;
public MyRenderer(Context context) : base(context)
{
_context = context;
}
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);
if(Element.IsFocused == false)
{
Control.EditText.ClearFocus();
}
}
}
}