Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有机会通过按下按钮或更改组件中的另一行来使 UIPickerView 自动滚动其组件?我的意思是我在 UIPickerView 中有两个组件,当我选择第一个组件时,我希望第二个组件自动滚动到另一个对象。甚至可能吗?
这是可能的,甚至很容易 - 您所要做的就是实现以下方法UIPickerViewDelegate:
UIPickerViewDelegate
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { if (row==3 && component==1) [pickerView selectRow:2 inComponent:0 animated:YES]; }