UIPickerView的selectRow:inComponent:animated:call pickerView:didSelectRow:inComponent:?

jos*_*im5 14 uipickerview

UIPickerView的selectRow:inComponent:animated:电话pickerView:didSelectRow:inComponent:吗?否则,我可以自己打电话吗?

谢谢

Mat*_*ang 25

你必须手动调用它,你通过委托来做.

// In this example the UIPickerView object is in a property
...
self.pickerView.datasource = self;
self.pickerView.delegate = self;

// Selects the row in the specified component
[self.pickerView selectRow:0 inComponent:0 animated:NO];

// Manually calls pickerView:didSelectRow:inComponent:
[self pickerView:self.pickerView didSelectRow:0 inComponent:0];
Run Code Online (Sandbox Code Playgroud)


jos*_*im5 5

它不会,尽管可以手动调用它。