【发布时间】:2011-07-22 20:06:26
【问题描述】:
我正在开发基于标签栏的应用程序的每个人。我在屏幕上打开相机以便拍照。但是当相机打开时,我看不到底部的拍照按钮。我的猜测是按钮隐藏在标签栏后面。如果我是对的,那么我需要删除相机屏幕上的标签栏。谁能告诉我如何删除相机屏幕上的标签栏?
我正在使用它来显示相机:
[self presentModalViewController:imagePickerController animated:YES];
我的应用是基于标签栏的,此代码是在与标签栏项目关联的视图控制器中编写的。
if (!imagePickerController) {
imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.delegate = self;
// If our device has a camera, we want to take a picture, otherwise, we just pick from
// photo library
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
[imagePickerController setSourceType:UIImagePickerControllerSourceTypeCamera];
}else
{
[imagePickerController setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Attention" message:@"Your device does not support taking photos from camera. Redirecting you to Photos Library instead." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
}
// image picker needs a delegate so we can respond to its messages
imagePickerController.delegate = self;
}
// Place image picker on the screen
[self presentModalViewController:imagePickerController animated:YES];
【问题讨论】:
-
那里应该没有标签栏。这是一个模态视图控制器,应该有一个拍照按钮……嗯。
-
嗨莱戈拉斯感谢您的回复。我有 iPhone 4G。当我在其上运行应用程序时,我看到底部的标签栏并且相机保持打开状态。在相机视图的顶部,我可以看到闪光灯和切换相机按钮。标签栏在那里,我不希望它出现在相机屏幕上。请帮忙!
-
根据我的经验,该选项卡无法显示。请发布您的完整代码。
-
Legolas,我发布了我的代码作为答案。
标签: iphone objective-c camera uitabbarcontroller