gpt4 book ai didi

android - 与 Apportable 交叉编译相机应用程序

转载 作者:行者123 更新时间:2023-11-29 03:27:04 27 4
gpt4 key购买 nike

我使用本教程实现了一个简单的 iOS 相机应用程序

http://www.appcoda.com/ios-programming-camera-iphone-app/

并尝试让它在 Galaxy s 4 上运行。

该应用程序由一个用于显示照片的 UIImageView 和 2 个按钮组成。一个用于使用相机拍照,一个用于选择照片。这些按钮与以下操作相关:


- (IBAction)takePhoto:(UIButton *)sender {



<pre><code>UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;

[self presentViewController:picker animated:YES completion:NULL];
</code></pre>

<p>}</p>

<p>-(IBAction)selectPhoto:(UIButton *)sender {</p>

<pre><code>UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

[self presentViewController:picker animated:YES completion:NULL];
</code></pre>

}

该应用程序在我的 iOS 设备上运行良好,但在 Android 设备上却崩溃了。有谁知道,为什么这不起作用或者如何在具有可移植性的跨平台应用程序中实现相机访问?

最佳答案

此版本的 Apportable 并未完全实现对相机的访问。如果您有一个应用程序需要它,那么直接使用 BridgeKit 添加它是相当简单的。目前我们正在致力于全面的相机支持,当它准备好供一般使用时我们将发布它。

关于android - 与 Apportable 交叉编译相机应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20323470/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com