在iOS中设置UIPickerView的默认选择?

时间:2011-10-31 19:49:28

标签: ios

  

可能重复:
  Picker, setting startup / default row?

我有一个带有2个UIPickerViews的viewcontroller,我以编程方式创建(No IB)。它们都是文本字段的输入,如下所示:

UIPickerView *heightPicker = [[UIPickerView alloc] initWithFrame:CGRectZero];
heightPicker.delegate = self;
heightPicker.dataSource = self;
[heightPicker setShowsSelectionIndicator:YES];
heightPicker.tag = 0;
self.heightField.inputView = heightPicker;
[heightPicker release];

如何设置这些选择器的默认选择?在用户点击相关文本字段之前,它们甚至不会被填充。

0 个答案:

没有答案