UISearchBar

Works great Jason! Would it also be possible to align the lines in the center? (I’m asking too much I guess) :slight_smile:

Thanks a lot again, Michel!
For some reason the GitHub app is only replying with a lot of error messages, but I could make it work finally with SourceTree. So here it is:

[quote=156748:@Ulrich Bogun]Thanks a lot again, Michel!
For some reason the GitHub app is only replying with a lot of error messages, but I could make it work finally with SourceTree. So here it is:
https://github.com/UBogun/Xojo-iosLib[/quote]

Neat :slight_smile: Congratulations !

I am going to add a link to your project on the XojoiOSWrapper page. If we all cross-reference the projects, that will be easier for people who need declares.

Yes it should be possible. I’m not at my computer right now to make the change but in the impl_viewforrowandcomponent shared method of the uipickerviewdatasourcemulitline class you should be able to change the text alignment to center of theView which is simply an iostextarea. If you add one line to do that it should work.

Yep, adding the following does center the text perfect:

theView.TextAlignment=xojo.iOSTextAlignment.Center

Yup thats the line. I’m glad it worked!

Is there a way to change the font (and font size) in the original UIPicker (with one line)?
Couldn’t find it myself.

No, that requires the customization only available in the multiline version. Give me a bit and I can make some changes so you can set each of the properties for each instance created. I’ll also make multiline a boolean.

Ok try the link above for the updated project. I added a few properties for TextFont, TextSize, and LinesPerRow. I tried to make it customizable for each column but it led to some interesting problems and serious visual oddities so you can only customize the TextFont, TextSize, and LinesPerRow for the entire UIPicker. Let me know if its what you were thinking of.

Awesome Jason, works as expected !

To add text center alignment :

Add a TextCenter boolean property to the PickerViewMultiline class
And add in the shared Method impl_viewForRowAndComponent:

if UIPickerViewDataSourceMultiline(dispatch.Value(pid)).myPicker.CenterText then theView.TextAlignment=xojo.iOSTextAlignment.Center

Jason, you noticed using the multiline approach, it uses more memory.
Is there a way to check how much memory an app uses? The iOSSimulator doesn’t seems to have scoop at this.

Hi Christoph, I’m not certain that it actually uses more memory. I’m just guessing it does since every option is created as an iostextarea to allow formatting. As to finding how much memory is used I’ve been trying to find it myself but it doesn’t seem available.

Memory usage by the iOS Simulator is normally displayed by Xcode when running the code there (objC or Swift), but since Xojo doesn’t use the Xcode environment except to use the simulator, you may not be able to see memory usage.

@Jason:

OK, the multiline Pickerview works in the iOSSimulator. I was about to finish my app and only now did test it on a real device.
Unfortunately the multiline Pickerview does not work on my iPhone 5 and 6
It just shows two small lines and no options. :confused:
I tried to change the fonts etc but no luck.

Here a screenshot when running the project of Jason.

Regarding the problem using the multiline version of the UIPicker made by Jason:
Is there a way to get some sort of report/log created on the real iDevice? Maybe this helps finding why it is only working in the iOSSimulator and not an a real device.

Just added to Device Deployment for Testing:

[quote]Getting Crash Logs
You can retrieve crash logs from your iOS device using the Devices window in Xcode. Plug your device in via USB and select it in the Devices window. Then click the “View Device Logs” button. You’ll see a list of crash logs (it may take a few minutes to download if you have a lot of them). Find your app in the list and click it to see the log.[/quote]

OK, the log didn’t show anything about the multiline UIPicker - hence it doesn’t crash. It just doesn’t work. :slight_smile:

A fix would be very welcome. :wink:

@Jason King do you have a version of UISearchBar that will build for 64-bit on 2015r1?

iOS dtplugin has this working with 64bit.