1

I designed a custom UIPicker for my iOS app and now i don't know how to implement it. I am new to iOS and i thought the Picker would be customizable but i think i was wrong.

Here is an image of it:

Custom iOS UIPicker

It's very minimalistic and simple so i think there has to be a way to implement it somehow? It would have 2 components and should behave as a usual UIPicker.

As far as i have seen the UIPicker class is only customizable to a certain degree, like changing the font size but not nearly as much as i would need it.

Drazen
  • 2,776
  • 1
  • 25
  • 39

1 Answers1

1

If your set of values is fairly small you could use two vertical UIScrollViews side-by-side, with a tall content area containing all your values.

Set the scrollviews to to 'paged' mode (where the page size is the height of one of your digits) - so the scrolling stops at each digit.

I think that'd work fine. If you have a huge number of possible values it'd take a lot of memory, but for a few it'd work.

EDIT: Looks like this control http://www.cocoacontrols.com/platforms/ios/controls/slnumberpickerview could be a useful starting point for customisation. Haven't tried it myself.

Ben Clayton
  • 80,996
  • 26
  • 120
  • 129
  • Thank you, the SLNumberPicker will help me. What would you consider a huge number? The left component would be around 200 numbers. – Drazen Jan 11 '13 at 13:14
  • it's really a question of how large the scroll view content area needs to be. 200 is large. Using UITableViews would be better as its more efficient with memory. I'm not sure how SLNumberPicker works, but I suspects it's done pretty well. – Ben Clayton Jan 11 '13 at 15:31