xamarin/Xamarin.Forms

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

开放

#7,433 创建于 2019年9月7日

 (5 条评论) (0 个反应) (0 位负责人)C# (1,926 个派生)batch import
help wantedp/iOS 🍎t/bug :bug:up-for-grabs

仓库指标

星标
 (5,644 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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

贡献者指南