pickerview titleForRow 的行始终从 2 开始
我在我的应用程序中使用 UIpickerview 。问题是,尽管 numberofRowsinComponent
返回更多行,但我的 pickerview titleforrow
函数始终返回 3 行。
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:
(NSInteger)component {
return [filteredTerms count]; }
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:
(NSInteger)row forComponent:(NSInteger)component {
CreateOrder *order = [filteredTerms objectAtIndex:row];
NSString *title;
title = order.kBranchName;
return title; }
我什至尝试对返回的数字或行进行硬编码,但它不起作用。 titleforrow
行始终从 2 开始。
I'm using UIpickerview in my app. The problem is that my pickerview titleforrow
function always return 3 rows although numberofRowsinComponent
return more rows.
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:
(NSInteger)component {
return [filteredTerms count]; }
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:
(NSInteger)row forComponent:(NSInteger)component {
CreateOrder *order = [filteredTerms objectAtIndex:row];
NSString *title;
title = order.kBranchName;
return title; }
I've even tried to hard code the number or rows returned, but it is not working. The titleforrow
row always start from 2.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个
Try this