开发者

UIPickerView - selecting component

In my iPhone app I have a UIPickerView with 2 columns.

When the user has clicked on the right column and selected an item, they then click a button. After this I want the left hand columns of the UIPickerView to be selected again.

I can select any row in a colu开发者_如何学Pythonmn (component) by using

[myPickerView selectRow:myRow inComponent:myComponent animated:YES];

Is there any way I can select the column itself ?

Thanks


Looking at the problem again (after a night's sleep !) I realised that I was looking at the wrong problem; what I really want to do is resize the columns to their initial state.

I can do this by using the following code

 self.pickerView.delegate = nil;
 self.pickerView.delegate = self;

with the resizing code in

-(CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component
{ ...
}

Thanks to Kovpas for the solution

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜