I am using Xcode 7.1.1 in my application I am using UIPickerView
for selecting countries. It's working fine, I need two separator lines.
I tried to use this code:
[myPicker.subviews objectAtIndex:1].backgroundColor = [UIColor redColor];
[myPicker.subviews objectAtIndex:2].backgroundColor = [UIColor redColor];
but it showing line only in the bottom, in the top there is no line. Is there any way to show two lines between the bold text?
the myPicker.subviews you are trying to access is not something you know about. It does not contain what you think, that is, view or anything. Its apple private api and it can be anything. You cannot depend on it. It also depends on OS.
To make the selected text some sort of distinctly visible what you alternatively do is for all model objects create a corresponding UILabel in a loop and then use them to supply the data to the picker. Then in the
pickerView:didSelectRow:inComponent:
set some distinct property of your UILabel like change its textcolor or font.