I have a UIPickerView with a variable number of components to display. In its contoller i have this -pickerView:withForComponent:
- (CGFloat)pickerView:(UIPickerView *)pv widthForComponent:(NSInteger)component {
CGFloat f;
if (component == 0) {
f = 30;
} else {
if ([componentsData count]>2) {
f = 260.0/([componentsData count]-1);
} else{
f = 260.0;
}
}
return f;
}
this works fine if I call [pickerView reloadAllComponents]
, but how could I extend a components width if it is touched (and of course shrink all others)?