开发者

Row selection does not call didSelectRow after reloading all components in that UIPickerView

开发者 https://www.devze.com 2023-02-04 09:30 出处:网络
Let\'s say for instance that I have a UIPickerView in my ViewController. Upon launch I use this code here:

Let's say for instance that I have a UIPickerView in my ViewController. Upon launch I use this code here:

[picker selectRow:3 inComponent:0 animated:NO];

After selecting the row that I want, why doesn't it trigger the didSelectRow code?

- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSIn开发者_StackOverflowteger)row inComponent:(NSInteger)component {}

Any ideas on why this is and how to fix this? Thanks


My solution to fix this was to just add a blank row and the picker loaded to the blank row. This forces the user to slide the UIPickerView so the didSelectRow get triggered.

0

精彩评论

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

关注公众号