如何在UITabBarController中设置UIImagePickerController(相机源)

发布于 2024-08-30 23:46:22 字数 306 浏览 1 评论 0原文

我想在 UITabBarController 内设置 UIImagePickerController 但我希望它来自源: UIImagePickerControllerSourceTypeCamera

我该如何设置?

我向 UITabBarController 添加了一个控制器并将其设置为 UIImagePickerController,但我找不到将其设置为 Interface Builder 中的相机的选项。我刚刚找到了 PhotoLibrary 和 SavedPhotos。

这可能吗?

提前致谢。

伊格纳西奥

I want to set UIImagePickerController inside my UITabBarController but I want it to be from source: UIImagePickerControllerSourceTypeCamera

How can I set this?

I added a controller to UITabBarController and set it as UIImagePickerController, but I cannot find a option to set it to be the Camera In Interface Builder. I just found PhotoLibrary and SavedPhotos.

Is this possible?

Thanks in advance.

Ignacio

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沒落の蓅哖 2024-09-06 23:46:22

回答我自己:
不可能,因为相机源在 Mac OS 中不可用(与模拟器相同),因此在 IB 中不可用。
这必须以编程方式完成。
因此:

  • 使用相机作为源创建 UIImagePickerController
  • 将其添加到 tabbarcontroller 的控制器中。

也许我不应该使用 UITabbarController 而应该使用 UITabBar 。 (所以我可以动态加载控制器并以模态方式显示它们。)

Answer to myself:
Is not possible since Camera source is not available in Mac OS, (same as simulator), hence not available in IB.
This has to be done programatically.
So:

  • create UIImagePickerController with camera as the source
  • add it into tabbarcontroller's controllers.

Probably i should not use UITabbarController but UITabBar instead. (So I can load controllers dinamically and show them modally.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文