我已经使用本教程实现了一个简单的 iOS 相机应用程序
http://www.appcoda.com/ios-programming-camera-iphone-app/
并试图让它在 Galaxy s 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];
}
该应用程序在我的 iOS 设备上运行良好,但它只是在 android 设备上崩溃。有谁知道,为什么这不起作用或如何在具有适当性的跨平台应用程序中实现相机访问?