Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在iphone sdk中单击选项卡栏中的选项卡打开摄像头?_Iphone_Camera_Uitabbarcontroller_Uiimagepickercontroller - Fatal编程技术网

如何在iphone sdk中单击选项卡栏中的选项卡打开摄像头?

如何在iphone sdk中单击选项卡栏中的选项卡打开摄像头?,iphone,camera,uitabbarcontroller,uiimagepickercontroller,Iphone,Camera,Uitabbarcontroller,Uiimagepickercontroller,如何通过单击tab bar应用程序中的tab来打开相机,我还想自定义相机控制器?我见过很多这样做的应用程序,它们有额外的功能,也像这样使用,也像这样使用,这是另一个我用谷歌搜索了一些链接,但没有得到完美的结果,我尝试通过-(void)viewwillbe现:(BOOL)动画但效果不太理想。任何人都可以指导我创建上述一些应用程序中的摄影机视图吗 我看到这个苹果是为了我看到的相机的自定义视图 嘿,有人有答案吗?试试这个代码片段 UIImagePickerController *picker = [[

如何通过单击tab bar应用程序中的tab来打开相机,我还想自定义相机控制器?我见过很多这样做的应用程序,它们有额外的功能,也像这样使用,也像这样使用,这是另一个我用谷歌搜索了一些链接,但没有得到完美的结果,我尝试通过
-(void)viewwillbe现:(BOOL)动画
但效果不太理想。任何人都可以指导我创建上述一些应用程序中的摄影机视图吗

我看到这个苹果是为了我看到的相机的自定义视图


嘿,有人有答案吗?

试试这个代码片段

UIImagePickerController *picker = [[UIImagePickerController alloc] init]; 
picker.delegate = self; 
picker.allowsEditing = YES;
if (([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])) 
{
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    [self presentModalViewController: picker animated:YES]; 
}
else
{
        // Put alert no camer found
}
[picker release];

嘿,这和你之前给出的答案是一样的。避免此类错误please@user1395270嘿,你已经完全阅读了我的问题吗?我真正想要的是,当我点击tabbar按钮时,它应该直接打开camera controller而不是
UIACtionSheet
请仔细阅读我的问题,查看我给出的示例链接。嘿,你已经完全阅读了我的问题吗?我真正想要的是什么我点击tabbar按钮,它应该直接打开相机控制器而不是
UIACtionSheet
请仔细阅读我的问题,查看我给出的示例链接。对不起。。。读这个@Hrushikesh:嘿,你试过这个家伙吗P请在第二代iPod(摄像头启用)设备中尝试此功能。请测试正确的代码,然后只向下投票的答案。我已经尝试过这样你的上述代码,但你看到了我提供的链接,他们直接打开定制相机点击tabbar按钮请看这个应用程序的他们是绝对免费的。你好!!我只是想做同样的事情,但我没有找到任何清晰的文档,你最后解决了吗??,谢谢@TurboManolo是的,我从我的应用程序需求中得到了解决方案,我只需要从AVCaptureSessionManager中制作自己的相机,这里是链接。如果我帮了你,请说出我的问题。
- (IBAction)buttonTap:(id)sender
{
    UIActionSheet * theActionSheet;

    if(![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
    {
        theActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:NSLocalizedString(@"Choose existing photo", nil) otherButtonTitles:nil, nil, nil];
        self.actionSheet = theActionSheet;
    }
    else
     {
         theActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:NSLocalizedString(@"Take photo", nil) otherButtonTitles:NSLocalizedString(@"Choose existing photo", nil), nil, nil];
         self.actionSheet = theActionSheet;
     }
     self.actionSheet.tag = 100;
     self.actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
     [self.actionSheet showInView:self.view.window];    // show from our table view (pops up in the middle of the table)
     [theActionSheet release];      
}