简体   繁体   中英

iOS 6 Custom UIPicker

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:

自定义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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM