如何使用自定义按钮关闭操作表 [英] how to dismiss action sheet with a custom button

查看:45
本文介绍了如何使用自定义按钮关闭操作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在操作表上创建了两个按钮和一个日期选择器.单击完成按钮后,我想关闭该操作表.任何人都可以提供有关取消该操作表的代码的帮助.

I created two buttons and one date picker on the action sheet.On clicking the done button i want to dismiss the action sheet.Can anyone please help with the code for dismissing the action sheet.

我正在使用以下代码为完成"按钮提供操作:

i'm using this code for giving action for done button:

[doneButton addTarget:self action:@selector(dismissActionSheet:) forControlEvents:UIControlEventValueChanged];

推荐答案

在dismissActionSheet方法中写入

in dismissActionSheet method write

[aSheet dismissWithClickedButtonIndex:0 animated:YES];

这篇关于如何使用自定义按钮关闭操作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆