PickerView 委托方法...
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
return 1;
}
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
if (didSelectedRow ==1)
{
strChkDistanceValue = [arrDistance objectAtIndex:row];
}
else
{
strChkDateRangeValue = [arrDateRange objectAtIndex:row];
}
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component;
{
if(didSelectedRow ==1)
{
return [arrDistance count];
}
else
{
return [arrDateRange count];
}
}
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component;
{
if(didSelectedRow ==1)
{
strChkarray =@"arrDistance";
return [arrDistance objectAtIndex:row];
}
else
{
strChkarray =@"arrDateRange";
return [arrDateRange objectAtIndex:row];
}
}
我正在使用上面的代码...我正在使用pickerview
in tableview
...有两个选择器视图...当我使用第一个选择器视图时,当我在选择器视图中选择第三行时,第一个选择器视图数组显示在选择器中我选择第二个选择器视图然后显示第二个数组列表,但第二个数组列表显示从第 3 行开始...与第一个选择器相同...但我想显示在 pickerviw 中数组的第一行..请帮帮我.. .
感谢和问候
Rahul Virja