【问题标题】:Hide UIAlertView programmatically?以编程方式隐藏 UIAlertView?
【发布时间】:2010-10-04 09:08:07
【问题描述】:

有没有办法以编程方式隐藏 UIAlertView?实际上,我在 UIAlertView 中添加了一个 UITextField,我想在用户按下键盘返回键时执行与“确定”按钮相同的操作。

【问题讨论】:

    标签: iphone uialertview


    【解决方案1】:

    打电话

    [theAlertView dismissWithClickedButtonIndex:0 animated:YES];
    

    当你处理返回键时。

    【讨论】:

    • 谢谢。如果你想让它更灵活一点,你也可以说[theAlertView dismissWithClickedButtonIndex: theAlertView.cancelButtonIndex animated:YES];[theAlertView dismissWithClickedButtonIndex: theAlertView.firstOtherButtonIndex animated:YES]; 来点击第一个不取消按钮。
    猜你喜欢
    • 2011-12-03
    • 1970-01-01
    • 1970-01-01
    • 2011-01-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多