[英]iPhone - UIImagePickerController - How to allow user to pick the source?
I'm writing an application that uses UIImagePickerController. 我正在编写一个使用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.
当您点击链接时,我想创建与twitterfon或safari中完全相同的选择界面。 It looks like some standard SDK thing but I have completely no clue where to find some sample code.
看起来像一些标准的SDK东西,但是我完全不知道在哪里可以找到一些示例代码。 I've googled for hours and I have nothing.
我已经搜索了几个小时,却一无所获。
I would really appreciate any tips. 我真的很感谢任何提示。 Thank you
谢谢
What you're looking for is the UIActionSheet. 您正在寻找的是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 您还需要使用为UIImagePickerController源定义的常量,即
UIImagePickerControllerSourceTypeCamera
UIImagePickerControllerSourceTypePhotoLibrary
That would be an UIActionSheet . 那将是一个UIActionSheet 。 Make sure to point its delegate property to your implementation of the UIActionSheetDelegate protocol to catch clicks on the buttons you define.
确保将其委托属性指向UIActionSheetDelegate协议的实现,以捕获对定义的按钮的单击。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.