MobileDatePicker with Xojo 2021 R1

Not yet, but it will be available in next release.

You can change the DatePicker display style like this:

Public Enum UIDatePickerStyle
automatic = 0
wheels
compact
inline
End Enum

Then set the style:

Static sSystemVersion As Double

//Get sSystemVersion only once
If sSystemVersion = 0.0 Then
  
  Declare Function currentDevice_ Lib "UIKit.framework" selector "currentDevice" (clsRef As ptr) As ptr
  Declare Function systemversion_ Lib "UIKit.framework" selector "systemVersion" (obj_id As ptr) As CFStringRef
  Declare Function NSClassFromString Lib "Foundation" (name As CFStringRef) As Ptr
  Dim device As Ptr = currentDevice_(NSClassFromString("UIDevice"))
  Dim systemVersion As Text = systemversion_(device)
  
  Try
    sSystemVersion = Double.FromText(systemVersion)
  Catch
  End Try
  
End If

if sSystemVersion >= 13.4 then
  declare sub preferredDatePickerStyle lib "UIKit.framework" selector "setPreferredDatePickerStyle:" (obj as ptr, mode as UIDatePickerStyle)
  
  Dim style As UIDatePickerStyle = UIDatePickerStyle.wheels
  preferredDatePickerStyle(DateTimePicker1.Handle, style)
End If
3 Likes