iOSKit PickerView on Container gives error

If I drag an iOSKit PickerView directly onto a Screen it works fine.

Now I want it to be on a Container so I can attach it to a ScrollableArea, but when dragged onto a Container and compiled, you get the error “Parameter ‘child’ expects class MobileUIControl, but this is class Extensions.PickerView”.

Is there a way to use an iOSKit PickerView on a Container?

Maybe there is some change with API 2.0 where iOSUserControls no longer work in a container? @Greg_O_Lone can the super class of the PickerView be converted to a Mobile variant, or does the class have to be rewritten now?

Not at my desk yet, but I believe there is now an iOSMobilecontrol that is compatible with the new layouts.

The class name is iOSMobileUserControl

1 Like

@Jason_King where do I place this ’ iOSMobileUserControl’ to get the PickerView working on a Container control?

I have tried changing the Super, but it broke other areas.

I’ll be honest I haven’t used API2.0 with iOS. But you should be able to change the super of the PickerView to the new iOSMobileUserControl class instead of iOSUserControl. Do do that find the Extensions module, select the PickerView class, then in the inspector change the super. If that still doesn’t work I’m not sure what might be broken but the fact it works on views and not container controls seems to be a Xojo bug

@Jason_King your suggestion works, thank you!

Adjustments to your iOSKit:

  1. Change the Super for both PickerView and PickerViewMultiline from ‘iOSUserControl’ to ‘iOSMobileUserControl
  2. In both their CreateView EventHandlers change ‘Return UInteger(selfRef)’ to ‘Return Ptr(selfRef)
  3. In the MissingControlsView window move the Open Event commands into a new Opening Event, then delete the old Open Event
  4. Comment out the PickerView2.Invalidate command

Using 2001r2 I can’t get the picker view to show up at all.
Before I spend too much time, has anyone else seen the same issue?

Do you mean 2021R2?

Working for me — BTW it is Invisible by default!

ahhhhhhh invisible!

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.