I have a three-component picker.
My problem is that, when the Selection Indicator is showing, the grey bar is in the right place (halfway down the picker), but the clear-looking overlay is too low. Normally you'd never see the selection indicator broken up this way.
If the setShowsSelectionIndicator is set to NO, it looks ok, but hard to use (can't see what is selected -- just have to assume the middle row is selected).
If selectRow:4 inComponent:0 animated:YES, it still doesn't look right. If I reload the components, it still doesn't look right.
The only thing that makes it look right is commenting out the selectRow inComponent animated. Looks right but I do want it to show what row the user previously selected.
It doesn't exactly work properly, either: I cannot select the last row in each component. As a matter of fact, the last row shows up under the clear bar (which is too low) when I try to select the last row, but because that is a row below the grey bar, I can only select down to the next-to-the-last-row.
Code:
mypicker = [[UIPickerView alloc] init];
[mypicker setDataSource:self];
[mypicker setDelegate:self];
mypickerTitles_Dil = [[NSArray alloc] initWithObjects:@"A", "B", "C", "D", "E", "F, "G", nil];
mypickerTitles_Eff = [[NSArray alloc] initWithObjects:@"A", "B", "C", "D", "E", "F, "G", "H", "I", "J", nil];
mypickerTitles_Stat = [[NSArray alloc] initWithObjects:@"A", "B", "C", "D", "E", "F, "G", nil];
[mypicker setShowsSelectionIndicator:YES];
//commenting out the next three lines makes the picker look right (but not properly populated with the 4th row of course).
[mypicker selectRow:4 inComponent:0 animated:NO];
[mypicker selectRow:4 inComponent:1 animated:NO];
[mypicker selectRow:4 inComponent:2 animated:NO];
[mypicker setFrame:CGRectMake(0, 98, 320, 253)];
[self addSubview:mypicker];
I could probably email someone a screenshot if that would help (so hard to describe). Thanks!