Quote:
Originally Posted by ikaroweb
I had already read that code, but frankly I just understood, there is another example to look at?
thanks
|
Well, to be honest, I find that code very simple. And it produces a row with image and title - so it is just what you need - why don't you just reuse the code? Import CustomPicker and CustomView classes to your project, go to the initWithFrame: method of CustomPicker class and then input the titles and images you want to display.
If you want to display something different in a row of the picker, all you need to do is to implement UIPickerViewDelegate method (in the sample it is done in UIPickerView):
Code:
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row
forComponent:(NSInteger)component reusingView:(UIView *)view;
In this method you have to construct the view you want to display in a particular row - either by creating your own UIView subclass (CustomView) or create the view dynamically within the method itself.
And then you display the picker just like you display default pickers.