簡體   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