为什么在调用[pickerView removeFromSuperview]后没有删除UIPickerView区域? 选择器视图在此代码中创建:
UIPickerView *pickerAirport = [[UIPickerView alloc] init];
pickerAirport.tag=0;
pickerAirport.dataSource = self;
pickerAirport.delegate = self;
_Airport.inputView = pickerAirport;
删除代码为:
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
if (pickerView.tag == 0)
{
NSDictionary * ptr_airport=[self.AllairportsDictionary objectAtIndex:row];
_Airport.text = ptr_airport[@"name"];
}
else
_State.text= ptr_aircraftState.StateAircraft[row];;
[pickerView removeFromSuperview];
self.view.center = originalCenter;
}
谢谢