iPhone 摄像头图像方向过度延迟的问题
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(dragger.frame.origin.x, dragger.frame.origin.y,dragger.frame.size.width, dragger.frame.size.height)] ;
imgView.image = dragger.image;
overlayView = [[UIView alloc] initWithFrame:CGRectMake(dragger.frame.origin.x,dragger.frame.origin.y,dragger.frame.size.width, dragger.frame.size.height)];
[overlayView addSubview:imgView];
//open the camera
self.picker = [[UIImagePickerController alloc] init];
self.picker.delegate = self;
self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.picker.cameraOverlayView=overlayView;
[self.navigationController presentModalViewController:self.picker animated:YES];
这在纵向模式下工作正常,但在横向模式下覆盖图像不会改变。
当我需要这方面的帮助时,我该如何实现这一目标?
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(dragger.frame.origin.x, dragger.frame.origin.y,dragger.frame.size.width, dragger.frame.size.height)] ;
imgView.image = dragger.image;
overlayView = [[UIView alloc] initWithFrame:CGRectMake(dragger.frame.origin.x,dragger.frame.origin.y,dragger.frame.size.width, dragger.frame.size.height)];
[overlayView addSubview:imgView];
//open the camera
self.picker = [[UIImagePickerController alloc] init];
self.picker.delegate = self;
self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.picker.cameraOverlayView=overlayView;
[self.navigationController presentModalViewController:self.picker animated:YES];
This works fine in portrait mode but the overlay image does not change while in the landscape mode.
How can i achieve this as I need help on this?
你需要注册方向的改变......像这样
,然后在同一个类中编写这个函数......
you need to register for change in orientation... like this
and then write this function in the same class....