IOS AlertView 自动消失

﹏ヽ暗。殇╰゛Y 2023-10-18 08:39 106阅读 0赞

UIAlertView *alert;

- (IBAction)Open:(id)sender {

alert = [[UIAlertView alloc]

initWithTitle:@”msg” message:@”sss” delegate:self cancelButtonTitle:@”取消” otherButtonTitles:@”确定”, nil];

[NSTimer scheduledTimerWithTimeInterval:5.0f target:self selector:@selector(performDismiss:) userInfo:nil repeats:NO];

[alert show];

}

-(void)performDismiss:(NSTimer*)timer

{

[alert dismissWithClickedButtonIndex:0 animated:NO];

}

发表评论

表情:
评论列表 (有 0 条评论,106人围观)

还没有评论,来说两句吧...

相关阅读

    相关 带有关闭按钮的alertView

    概述 由于讨厌系统自带的alertView只能通过点击按钮才能关闭。你说万一按钮区域都是功能性的操作呢(这可不是我胡思乱想哦,要怪就产品的想法吧,呵呵哒),所以我们还是应