我正致力于提供从任何手机捕获图像功能并将其上传到网站服务器的项目。
但我在使用iphone时遇到了问题。
它显示"从gallary中选择"当用户点击Snap it按钮时,也可以使用该选项。
这是图片:
是否可以禁用此选项?如何在使用本网站时从iphone禁用此选项?
我想删除选项"选择现有"。
答案 0 :(得分:1)
试用此代码:
UIImagePickerController *imagePickController=[[UIImagePickerController alloc]init];
//You can use isSourceTypeAvailable to check
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
imagePickController.sourceType=UIImagePickerControllerSourceTypeCamera;
imagePickController.showsCameraControls=YES;
// self.usingPopover = NO;
}
else if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {//Check PhotoLibrary available or not
imagePickController.sourceType=UIImagePickerControllerSourceTypePhotoLibrary;
imagePickController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
}
else if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum]) //Check front Camera available or not
imagePickController.sourceType=UIImagePickerControllerSourceTypeSavedPhotosAlbum;
//else //!!!!!!!!!!!exception
imagePickController.delegate=self;
imagePickController.allowsEditing=NO;
[self presentModalViewController:imagePickController animated:YES];