Hello,
You'll need to use Handler to do both, please refer to the code below:
DatePicker control is causing one horizontal line, I need to remove this line
protected override void OnHandlerChanged()
{
base.OnHandlerChanged();
#if ANDROID
var v = test.Handler.PlatformView as EditText;
GradientDrawable gd = new GradientDrawable();
gd.SetColor(global::Android.Graphics.Color.Transparent);
// handler.PlatformView.SetBackgroundDrawable(gd); deprecated
v.SetBackground(gd);
#endif
}
Is there a way that even after clicking on image control, date selection pop up could get shown.
In xaml:
<VerticalStackLayout Padding="20">
<DatePicker x:Name="test"/>
<Image Source="dotnet_bot.png" Focused="Image_Focused">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"
NumberOfTapsRequired="1" />
</Image.GestureRecognizers>
</Image>
</VerticalStackLayout>
In code-behind
private void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
#if ANDROID
var v = test.Handler.PlatformView as EditText;
v.CallOnClick();
#endif
}
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.