I dont know this is a correct way or not but you can set your UIPickerView
background image ... I have done it once.
See this :-
//Make a view to set as background of UIPickerView
UIView * viewForPickerView = [[UIView alloc]initWithFrame:CGRectMake(0.0, 0.0, 320.0, 216.0)];
[viewForPickerView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"pickerViewBackground.png"]]];
[[[pickerView subviews]objectAtIndex:2] addSubview: viewForPickerView];
//UIPickerView has 8 subviews like, background, rows, container etc.
// hide unnecessary subview
[(UIView*)[[pickerView subviews] objectAtIndex:3] setHidden:YES];
[(UIView*)[[pickerView subviews] objectAtIndex:5] setHidden:YES];
[(UIView*)[[pickerView subviews] objectAtIndex:6] setHidden:YES];
[(UIView*)[[pickerView subviews] objectAtIndex:7] setHidden:YES];
[(UIView*)[[pickerView subviews] objectAtIndex:8] setHidden:YES];
And now add a UILabel
just on your UIPickerView
's selectionIndicator
, and use label
as a selectionIndicator
.
you can manage it in your own way.
Thank you!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…