このチュートリアルを使用して、シンプルな iOS カメラ アプリを実装しました。
http://www.appcoda.com/ios-programming-camera-iphone-app/
Galaxy s 4で動作させようとしました。
アプリケーションは、写真を表示する UIImageView と 2 つのボタンで構成されます。1 つはカメラで写真を撮り、もう 1 つは写真を選択します。ボタンは次のアクションに接続されています。
- (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 デバイスでは単にクラッシュします。なぜこれが機能しないのか、クロスプラットフォームアプリケーションで apportable を使用してカメラアクセスを実装する方法を知っている人はいますか?