【问题标题】:UIAlertView turn off auto dismiss [duplicate]UIAlertView关闭自动关闭[重复]
【发布时间】:2015-02-14 02:33:32
【问题描述】:

当点击按钮“ok”时警报自动关闭,如何防止它

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title" 
                                                    message:@"Message" 
                                                    delegate:self 
                                                    cancelButtonTitle:@"OK" 
                                                    otherButtonTitles:nil];
    [alert show];

我想点击按钮“确定”而不是关闭警报 ..if(logics){ not dismis } else {dismiss alert }

感谢

【问题讨论】:

  • 试试github.com/regexident/DLAlertView 之类的方法,它允许您使用委托或块来响应行为。
  • 你想完成什么?
  • 重复链接帖子子类UIAlertView中的解决方案。请记住,UIAlertView 现在在 iOS 8 中已弃用,取而代之的是 UIAlertController

标签: ios objective-c uialertview dismiss


【解决方案1】:

如果您想要这种行为,您需要创建自己的 UI 组件。 UIAlertView 旨在显示一些基本信息并为您提供一些按钮选项,一旦单击,就会关闭警报视图。

【讨论】:

    猜你喜欢
    • 2011-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-21
    相关资源
    最近更新 更多