开发者

Want to know when UIPickerViewDataSource finished

开发者 https://www.devze.com 2023-02-21 13:14 出处:网络
I save the last user selection in the picker view. But when the view is opened again I do not where to use

I save the last user selection in the picker view. But when the view is opened again I do not where to use

[pickerView selectRow:lastSelectedRow inComponent:lastSelectedComponent animated:YES];

If I use it in 开发者_如何学运维viewDidLoad the problem is UIPickerViewDataSource has not finished yet, so the scrolling is not correct. I can not find delegate function after UIPickerViewDataSource is finished. Where can I use the above line of code?


You're passing YES in animated argument, thus I assume you want to see it animated -> you should call this method in viewDidAppear, not in viewDidLoad.

0

精彩评论

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