繁体   English   中英

如何检测UIActionSheet何时被关闭?

[英]How do I detect when a UIActionSheet has been dismissed?

我对iPhone开发人员来说还很陌生,因此可以提供任何帮助。

我正在函数中创建一个动作表,并将其添加到当前视图中。 我将工作表代表定为“自己”,并且未保留操作表。 是否有类似datePicker的didSelectRow的功能? 诸如“ didDismissWithButtonAtIndex”之类的东西,或者让我检测何时关闭操作表的东西?

谢谢,迈克

您正在寻找UIActionSheetDelegate方法– actionSheet:didDismissWithButtonIndex: 文档中

actionSheet:didDismissWithButtonIndex:

从屏幕上取消操作表后发送给代表。

 - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex 

参量
actionSheet
被解雇的行动表。

buttonIndex
单击的按钮的索引。 按钮索引从0开始。 如果这是取消按钮索引,则操作表正在取消。 如果为-1 ,则未设置取消按钮索引。

讨论区
动画结束并隐藏视图后,将调用此方法。

NSLog(@"actionsheetvisible %@", actionSheet.isVisible?@"YES":@"NO");

使用isVisible属性。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM