Component like TCalendarEdit

Hi!

I was searching for an iCL-component that does the same as the TCalendarEdit from XE5. It seems to be a TTMSFMXNativeUITextField combined with a TTMSFMXNativeUIDatePicker as a popover.

I didn't get this working with the standard-iCL-components.

Any hint on this is greatly appreciated.

Thanks a lot!
Christian

If you are testing on an iPhone / iPod device, you will not be able to use the popover as this is iPad only. Currently, the textfield doesn't expose any tap events so you will not be able to show the datepicker in a consistent way. 


We have added this on our todolist for investigation.

Kind Regards, 
Pieter

OK. So what is the best way to get a iPad-like date time picker? Do I really have to add the big size iCL-component on the form and then show or hide it if the textfield is focussed? In this case I will also get a problem validating manual typing in the textfield.

Any suggestions on how to get a date or date-time within iCL?
I would preffer not to use any XE5-FMX-controls.

Best regards
Christian

The TCalendarEdit also doesn't allow typing manually, it only shows the UIDatePicker within an UIView and uses an UIPopoverController on the iPad. When using an iCL control, you can use the IsIpad function that tells you on which type of device you are. If true, you can use the popover implementation in the OnShouldBeginEditing 


procedure TForm1.TMSFMXNativeUITextField1ShouldBeginEditing(Sender: TObject;
  var AShouldEdit: Boolean);
begin
  AShouldEdit := False;
  if isIPad then
    //show popover
  else
    //show UIView or toggle visibility of UIDatePicker
end;

Please note that the UIDatePicker size cannot be changed.

Kind Regards, 
Pieter