iPhone相机工具栏

时间:2011-11-22 05:12:35

标签: iphone

我正在制作iPhone相机应用程序,我在底部添加自定义按钮。

picpicker.showsCameraControls = NO;
picpicker.navigationBarHidden = NO;

基本上我希望我的应用看起来像iPhone附带的相机应用程序,以便用户可以继续拍摄多张照片或视频,此外我还会添加一些额外的按钮/功能。

我想问的是,当我启动我的应用时

  • 我创建了一个叠加层
  • 在叠加层中我添加了一个工具栏
  • 在工具栏中,我添加了两个自定义按钮-Take Pic,-Done

我有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
{ ......
........

0 个答案:

没有答案