我使用本教程
实现了一个简单的iOS相机应用程序http://www.appcoda.com/ios-programming-camera-iphone-app/
并试图让它在星系4上工作。
该应用程序包含一个UIImageView来显示照片和2个按钮。一个用相机拍照,一个用来选择照片。按钮连接到这些操作:
- (IBAction)takePhoto:(UIButton *)sender {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:picker animated:YES completion:NULL];
}
-(IBAction)selectPhoto:(UIButton *)sender {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:picker animated:YES completion:NULL];
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:picker animated:YES completion:NULL];
该应用程序在我的iOS设备上正常工作,但它只是在Android设备上崩溃。有谁知道,为什么这不起作用或如何在具有apportable的跨平台应用程序中实现相机访问?
答案 0 :(得分:1)
此版本的Apportable未完全实现对相机的访问。如果您有一个需要它的应用程序,直接使用BridgeKit添加它是相当简单的。我们目前正致力于提供完整的相机支持,我们将在准备好一般使用时将其发布。