Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-25-2012, 06:27 AM   #1 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 15
Killbill is on a distinguished road
Default Dismiss camera

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
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
in the .m

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];
}
Killbill is offline   Reply With Quote
Reply

Bookmarks

Tags
camera, dismiss

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 398
11 members and 387 guests
Atatator, condor304, FrankWeller, glenn_sayers, iphonedevshani, MAMN84, mraalex, PowerGoofy, QuantumDoja, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,674
Threads: 94,123
Posts: 402,908
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Atatator
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:52 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0