正如您在this video中看到的,每当我尝试裁剪或移动裁剪框时,它都会弹回。我找不到任何方法来做到这一点,我认为我的代码是正确的。我该怎么做呢?
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"Device has no camera"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[myAlertView show];
}
}
- (IBAction)takePhoto:(UIButton *)sender {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:picker animated:YES completion:NULL];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
UIImage *chosenImage = info[UIImagePickerControllerEditedImage];
self.imageView.image = chosenImage;
[picker dismissViewControllerAnimated:YES completion:NULL];
}发布于 2013-07-20 21:21:59
如果图像距离太远,请使用此方法将其重新设置为动画:
[UIView animateWithDuration: animations: completion:]动画:是一个块,如果你想改变你添加的[image setRect:(CGRectMake(orginPosition.x, orginPosition.y, size.width, size.height))];的图像位置,它会在一段时间内改变例如CGRects
完成:是一个块,但不是必需的。
https://stackoverflow.com/questions/17762574
复制相似问题