tags:

views:

21

answers:

2

Hi guys, been looking at this for days..

- (void)viewDidAppear:(BOOL)animated {


#if !TARGET_IPHONE_SIMULATOR

    UIButton *returnButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    returnButton.frame = CGRectMake(0, 0, 100, 100);
    [returnButton setTitle:@"Tap here to return" forState:UIControlStateNormal];
    [returnButton addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:returnButton];
    [self.view bringSubviewToFront:returnButton];

    [[self cameraController] setCameraOverlayView:[self view]];
    [self presentModalViewController:[self cameraController] animated:YES];
    [[self view] setFrame:[[[self cameraController] view] bounds]];
#endif

    [super viewDidAppear:animated];
}
A: 

I think you need to hide the defaul camera control first by using : [[self cameraController] setShowsCameraControls:NO] . See more here

The default value of this property is YES, which specifies that the default camera controls are visible in the picker. Set it to NO to hide the default controls if you want to instead provide a custom overlay view using the cameraOverlayView property.

vodkhang
A: 

[[self cameraController] setCameraOverlayView:[self view]]; is almost certainly wrong. When viewDidAppear: is called, your view is already in the view hierarchy. Suddenly setting it as the cameraOverlayView is unlikely to do the right thing.

tc.