无按钮警告框

  UIAlertView * baseAlert;
  baseAlert  =  [[[UIAlertView alloc]initWithTitle:@"please wait" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:nil] autorelease];//定义
        [baseAlert show];
        UIActivityIndicatorView *aiv = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];//定义菊花圈圈
        aiv.center = CGPointMake(baseAlert.bounds.size.width/2.0f, baseAlert.bounds.size.height-40.0f);
        [aiv startAnimating];//开始转圈
        [baseAlert addSubview:aiv];//添加圈圈到baseAlert
       
        [aiv release];
       [self performSelector:@selector(performdismiss) withObject:nil afterDelay:3.0f];//转圈3秒就自动消失, 不然无限的转


-(void)performdismiss
{
    [baseAlert dismissWithClickedButtonIndex:0 animated:NO];
}
       

posted @ 2012-05-04 23:28  高笑228  阅读(166)  评论(0编辑  收藏  举报