Picker Title show top position while click cancel in popup using xamarin forms

285 Views Asked by At

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?

Screenshoot below: While click cancel button in picker popup

Placeholder text moves top. It should be in the default state

Xaml Code:

<local:CustomPicker ItemsSource="{Binding CommentList, Mode=TwoWay}" SelectedItem="{Binding SelectedComment, Mode=TwoWay}" Grid.Row="0" TextColor="Black" ItemDisplayBinding="{Binding Text, Mode=TwoWay}"  SelectedIndex="{Binding CommentIndex, Mode=TwoWay}"
                                        Image="downarrow" Title="Picker" BackgroundColor="White" TitleColor="Gray">
                    </local:CustomPicker>

Renderer Code:

using Xamarin.Forms.Material.Android;

[assembly: ExportRenderer(typeof(CustomPicker), typeof(CustomPickerRenderer), new[] { typeof(VisualMarker.MaterialVisual) })]
namespace MyApp.Android
{
    public class CustomPickerRenderer: MaterialPickerRenderer
    {
        //...
    }
}
0

There are 0 best solutions below