xamarin/Xamarin.Forms

XF DatePicker not working properly while DatePicker and UIDatePicker added in same page in iOS platform

Aperta

#7433 aperta il 7 set 2019

 (5 commenti) (0 reazioni) (0 assegnatari)C# (1926 fork)batch import
help wantedp/iOS 🍎t/bug :bug:up-for-grabs

Metriche repository

Star
 (5644 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Description

I am working in custom control. I implemented DatePicker in Xamarin.Forms, in iOS renderer file I have used UIDatePicker. While my custom DatePicker and Xamarin.Forms DatePicker added in same XAML page XF DatePicker display and picker popup values are not same always.

I tried by reverting my changes in iOS renderer and issue does not occur if UIDatePicker not initialized.

So, I found that there is conflict while DatePicker and UIDatePicker added in same page.

Steps to Reproduce

I replicated the issue in a simple sample,

  1. Run the attached sample
  2. Note DatePicker and UIDatePicker in the same page
  3. Click XF DatePicker to open popup.
  4. Note Display value and popup value are not same
  5. Change date in popup and you can see DatePicker display different date in view.

Expected Behavior

DatePicker should act as normal while DatePicker and UIDatePicker are in same page.

Actual Behavior

When I click Xamarin.Forms DatePicker display value shows the given date and popup shows different date. If I select any other date in popup it doesn't update selected value to display. But my custom DatePicker working fine as expected.

Basic Information

  • Version with issue: XF 3.6.0.344
  • IDE: Visual Studio 2017
  • Platform Target Frameworks:
    • iOS: 11
  • Affected Devices: Tested in iPhone 8 and XS max

Screenshots

Note: DatePicker dispaly 9/7/2019(September 7,2019) and popup shows August 7,2018.

image

Reproduction Link

PickerRenderer.zip

Guida contributor