I have an app showing the camera picture with a button on top.
This button should dismiss the camera view and go to the second view, but it doesn't.
It restarts the camera instead, and stays on the first view.
Can you have a look what i'm doing wrong?
An example project can be found here: http://wtrns.fr/P4oekRGDMncWLq
In the .h
in the .m
This button should dismiss the camera view and go to the second view, but it doesn't.
It restarts the camera instead, and stays on the first view.
Can you have a look what i'm doing wrong?
An example project can be found here: http://wtrns.fr/P4oekRGDMncWLq
In the .h
Code:
#import <UIKit/UIKit.h>
#define CAMERA_TRANSFORM_X 1
#define CAMERA_TRANSFORM_Y 1.12412
#define SCREEN_WIDTH 320
#define SCREEN_HEIGTH 480
@interface ViewController : UIViewController{
UIView *overlayView;}
-(IBAction)tosecondview:(id)sender;
@property (nonatomic, retain) IBOutlet UIView *overlayView;
@end
Code:
@implementation ViewController
@synthesize overlayView;
-(IBAction)tosecondview:(id)sender{
[self dismissModalViewControllerAnimated:NO];
SecondViewController * mysecondViewController = [[SecondViewController alloc] initWithNibName:nil bundle:nil];
[mysecondViewController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self presentModalViewController:mysecondViewController animated:YES];
}
....
- (void) viewDidAppear:(BOOL)animated {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.showsCameraControls = NO;
picker.navigationBarHidden = YES;
picker.wantsFullScreenLayout = YES;
picker.cameraViewTransform = CGAffineTransformScale(picker.cameraViewTransform, CAMERA_TRANSFORM_X, CAMERA_TRANSFORM_Y);
picker.cameraOverlayView = overlayView;
[self presentModalViewController:picker animated:NO];
[super viewDidAppear:YES];
}