首页 > 其他 > 详细

UIAlertView 的使用

时间:2015-09-29 22:01:23      阅读:168      评论:0      收藏:0      [点我收藏+]

关于提示框的编辑

弹出框自己消失 
-(void)rightrightBarButtonItemAction:(UIBarButtonItem *)sender{ 
UIAlertView *alertView=[[UIAlertView alloc]initWithTitle:@”提示” message:@”收藏成功” delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];

[alertView show];
[alertView dismissWithClickedButtonIndex:0 animated:YES];

}

弹出框定时消失 
弹出框定时消失

    • (void)timerFireMethod:(NSTimer*)theTimer//弹出框 

      UIAlertView promptAlert = (UIAlertView)[theTimer userInfo]; 
      [promptAlert dismissWithClickedButtonIndex:0 animated:NO]; 
      promptAlert =NULL; 
      }

    • (void)showAlert:(NSString *) _message{//时间 
      UIAlertView *promptAlert = [[UIAlertView alloc] initWithTitle:_message message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];

      [NSTimer scheduledTimerWithTimeInterval:1.5f 
      target:self 
      selector:@selector(timerFireMethod:) 
      userInfo:promptAlert 
      repeats:YES]; 
      [promptAlert show]; 
      }

UIAlertView 的使用

原文:http://www.cnblogs.com/LNdbk/p/4847372.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!