如何在选择日期时隐藏选择器?
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
countryCodeString = [NSString stringWithFormat:@"+%@",[array_countryCode objectAtIndex:row]];
[countryCodeButton setTitle:countryCodeString forState:UIControlStateNormal];
}
答案 0 :(得分:1)
- (void)textFieldDidEndEditing:(UITextField *)textField {
[picker removeFromSupperView];
}
答案 1 :(得分:0)
我们可以隐藏其组件选择的pickerview,如下所示......
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
countryCodeString = [NSString stringWithFormat:@" +%@",[array_countryCode objectAtIndex:row]];
[countryCodeButton setTitle:countryCodeString forState:UIControlStateNormal];
[picker removeFromSupperView]; }