我正在制作iPhone相机应用程序,我在底部添加自定义按钮。
picpicker.showsCameraControls = NO;
picpicker.navigationBarHidden = NO;
基本上我希望我的应用看起来像iPhone附带的相机应用程序,以便用户可以继续拍摄多张照片或视频,此外我还会添加一些额外的按钮/功能。
我想问的是,当我启动我的应用时
我有Done功能正确实现但是如何实现Take pic按钮功能。
UIBarButtonItem *takePicButton = [[UIBarButtonItem alloc] initWithTitle:@"Take Pic" style:(UIBarButtonItemStyleBordered) target:self action:@selector(takePictureWithCamera)];
UIBarButtonItem *cancelPicButton = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:(UIBarButtonItemStyleBordered) target:self action:@selector(cancelPictureWithCamera)];
NSArray *items = [NSArray arrayWithObjects: takePicButton, cancelPicButton, nil];
[toolbar setItems:items animated:NO];
[overlayview addSubview:toolbar];
... ...
-(IBAction)cancelPictureWithCamera
{
NSLog(@"INSIDE cancelPictureWithCamera Function");
[self dismissModalViewControllerAnimated:YES];
}
-(IBAction)takePictureWithCamera
{
NSLog(@"INSIDE takePictureWithCamera Function");
?????
//I can't do this as the Xcode doesn't like it
[self imagePickerController];
}
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{ ......
........