The UIPickerView
that appears in Safari has a check mark beside the current choice. Is there a built-in way to get this, or do I have to program it up myself? If I do have to create it, can anyone point me to some code to do this? Thanks
Here is some official sample code for customizing UIPicker view: http://developer.apple.com/library/ios/#samplecode/UICatalog/Introduction/Intro.html
In particular, refer to classes PickerViewController.{h, m} , CustomPickerDataSource.{h, m} and CustomView.{h, m} in the example. You can create a similar custom UIPickerView with a tick image which gets displayed only to the left for the selected item and change the text color of selected item.
Also, remember to set myPickerView.showsSelectionIndicator = NO;
to remove the semi-transparent bar above the selected item.
You need to implement -pickerView:viewForRow:forComponent:reusingView:
from the UIPickerViewDelegate.
You have to create a view, that contains a UIButton with the checkmark image, and return it from -pickerView:viewForRow:forComponent:reusingView:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With