我有一个UIActionSheet
来实现clickedbuttonAtIndex:
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc]init];
imagePickerController.navigationBar.translucent = NO;
imagePickerController.navigationBar.tintColor = [UIColor colorWithHexString:@"#669900"];
switch (buttonIndex)
{
case 0:
imagePickerController.delegate = self;
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:imagePickerController animated:YES completion:nil];
break;
case 1:
imagePickerController.delegate = self;
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:imagePickerController animated:YES completion:nil];
break;
}
}
其中选项 1 拉出相机,选项 2 拉出用户的照片库。问题是,当您在相机上点击“取消”并返回原始视图时,它会重新加载两个位于主表视图中UITextFields
的{{1}} UITableViewCell
。我不需要看到重装。在照片库视图中点击“取消”时不会发生此活动。
我尝试过使用它:
-(void)viewWillAppear:(BOOL)animated
{
[super viewDidLoad];
}
- 但这并未预先加载UITextFields
为什么取消按钮重新加载这些UITextFields,我该怎么做才能阻止它?
〜谢谢,Chisx