UIPicker: Difference between revisions

From Medien Wiki
(Created page with "== Introduction== === Required images=== Here you find a customizable PickerView, which is limited to text. You need at least 4 pictures for the pickerView: - a backgroundView fo...")
 
No edit summary
Line 2: Line 2:
=== Required images===
=== Required images===
Here you find a customizable PickerView, which is limited to text. You need at least 4 pictures for the pickerView:
Here you find a customizable PickerView, which is limited to text. You need at least 4 pictures for the pickerView:
- a backgroundView for the whole picker
* a backgroundView for the whole picker
- a backgroundView for every picker item
* a backgroundView for every picker item
- a image for the selected item in the picker item
* a image for the selected item in the picker item
- an overlay image for the picker item, you can use this, to darken the top most and bottom most elements
* an overlay image for the picker item, you can use this, to darken the top most and bottom most elements
//Link to UImage
//Link to UImage


=== Required objects ===
=== Required objects ===
- Titles for every picker item (The PickerView can have multiple pickers) as NSStrings in an NSArray
* Titles for every picker item (The PickerView can have multiple pickers) as NSStrings in an NSArray
- items, which should be in a picker item (As a NSArray of NSStrings, stored in a NSDictionary, the keys should be equal to the titles)
* items, which should be in a picker item (As a NSArray of NSStrings, stored in a NSDictionary, the keys should be equal to the titles)
- the frame for every picker item (As a CGRect stored as a NSValue in a NSArray)
* the frame for every picker item (As a CGRect stored as a NSValue in a NSArray)
- selected items in every picker item (As a NSNumber stored in a NSArray)
* selected items in every picker item (As a NSNumber stored in a NSArray)
- the height of every item in the picker item
* the height of every item in the picker item


For example with two pickers in the pickerView:
For example with two pickers in the pickerView: