Extend PickerViews Component while touching

Posted by vikingosegundo on Stack Overflow See other posts from Stack Overflow or by vikingosegundo
Published on 2010-05-18T15:55:53Z Indexed on 2010/05/18 21:40 UTC
Read the original article Hit count: 176

Filed under:
|
|
|

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)?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about uikit