我正在尝试创建一个类似于Safari的UIActionSheet
。我无法在Apple文档中找到有关如何使UIActionSheet
看起来像这样的内容。是否有一个我缺少的控件/ API,我可以使用它来创建下面的内容,或者我是否坚持创建自己的UIView并显示它?
Ninja Edit :这似乎是一个UIActivityViewController。有什么方法可以添加我自己的自定义操作吗?
答案 0 :(得分:4)
这不是UIActionSheet。
这是一个UIActivityViewController:
来自Apple的文档:
The UIActivityViewController class is a standard view controller that you can use to offer
various services from your application. The system provides several standard services,
such as copying items to the pasteboard, posting content to social media sites, sending
items via email or SMS, and more. Apps can also define custom services.
Your app is responsible for configuring, presenting, and dismissing this view controller.
Configuration for the view controller involves specifying the data objects on which the
view controller should act. (You can also specify the list of custom services your app
supports.) When presenting the view controller, you must do so using the appropriate means
for the current device. On iPad, you must present the view controller in a popover. On
iPhone and iPod touch, you must present it modally.
答案 1 :(得分:2)
关于忍者编辑:是的,您可以向UIActivityViewController添加操作。
在Apple's doc,或this SO question上查看UIActivity。