iPhone - UIImagePickerController - 如何允许用户选择来源?
我正在编写一个使用 UIImagePickerController 的应用程序。 我想让用户选择图片来源,要么拍摄新照片,要么从现有照片中进行选择。 当您按住链接时,我想创建与 twitterfon 或 safari 中完全相同的选择界面。 它看起来像一些标准的 SDK 东西,但我完全不知道在哪里可以找到一些示例代码。 我用谷歌搜索了几个小时,但一无所获。
我真的很感激任何提示。 谢谢
I'm writing an application that uses UIImagePickerController. I'd like to give users choice of source of pictures, either take a new photo or choose from existing ones. I'd like to create exactly the same selection interface as is in twitterfon or in safari when you hold tap on the link. It looks like some standard SDK thing but I have completely no clue where to find some sample code. I've googled for hours and I have nothing.
I would really appreciate any tips.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在寻找的是 UIActionSheet。 该文档包含设置所需的一切以及如何响应按下哪个按钮。
您还需要使用为 UIImagePickerController 源定义的常量,即
What you're looking for is the UIActionSheet. The documentation has everything you need to set one up and how to respond to which button is pressed.
You'll also want to use the constants defined for the UIImagePickerController sources, namely
这将是一个 UIActionSheet。 确保将其委托属性指向 UIActionSheetDelegate 协议来捕获您定义的按钮上的点击。
That would be an UIActionSheet. Make sure to point its delegate property to your implementation of the UIActionSheetDelegate protocol to catch clicks on the buttons you define.