UIAlertView 实现自动消失

来源:互联网 发布:申请淘宝介入流程 编辑:程序博客网 时间:2024/05/06 12:11
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"已收藏" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:nil];                           [alert show];                              [self performSelector:@selector(disMissAlert:) withObject:alert afterDelay:2.0f];

-(void)disMissAlert:(UIAlertView*)alert{        if (alert) {      [alert dismissWithClickedButtonIndex:[alert cancelButtonIndex] animated:NO];        [alert release];    }   }

以上代码便可以实现自动消失。



0 0
原创粉丝点击