现在的位置: 首页 > 综合 > 正文

UIAlertView 自动消失

2013年10月06日 ⁄ 综合 ⁄ 共 429字 ⁄ 字号 评论关闭

- (IBAction)submit:(id)sender {

   
UIAlertView *alertview=[[UIAlertView
alloc]initWithTitle:@"提交成功!" message:@"使用中如有疑问,欢迎拨打我们的400电话!\n(三秒钟自动跳转)"
delegate:nil cancelButtonTitle:nil otherButtonTitles:nil,
nil];

    [alertview
show];

    [self
performSelector:@selector(dimissAlert:)
withObject:alertview
afterDelay
:3];

}

- (void)dimissAlert:(UIAlertView *)alert {

   
if(alert) {

        [alert dismissWithClickedButtonIndex:[alert
cancelButtonIndex] animated:YES];

    }

}

抱歉!评论已关闭.