看到Itouch 中的时钟程序,,,选择时间时,在selectIndicator 上都有一个单位,可能可以通过这个方法实现...
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component————这个方法是定义在PickerView接收点击,滚动,选择事件的时候所做出的反映。
{
if (component == 0) {
if (row >0) {
[pickerView reloadAllComponents];————点击第一列中的每一行,第二列中的行数都reload一遍。
}
}
}
-(UIView*)pickerView:(UIPickerView*)tpickerView viewForRow:(NSInteger)row forComponent:(NSInteger)componentreusingView:(UIView *)view
{
//PickerView出现时默认显示当天的月份和日期
[self.datePickerView selectRow:[self.monthLable.text intValue]-1 inComponent:0 animated:YES];
[self.datePickerView selectRow:[self.dayLable.text intValue]-1 inComponent:1 animated:YES];