iOS开发- 自动消失的弹出框
来源:互联网 发布:跳跃网络贴吧 编辑:程序博客网 时间:2024/04/29 23:43
- (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 delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]; [NSTimer scheduledTimerWithTimeInterval:1.5f target:self selector:@selector(timerFireMethod:) userInfo:promptAlert repeats:YES]; [promptAlert show];}
在需要显示弹出框的地方调用[self showAlert:@"测试"];即可。
原理: 弹出的时候, 设置一个定时器。 这里设置1.5秒后, 把当前的弹出框置空。 (promptAlert =NULL;)
85 1
- iOS开发- 自动消失的弹出框
- iOS开发- 自动消失的弹出框
- iOS开发-自动消失的弹出框
- iOS 弹出框自动消失
- 弹出框自动消失
- 自定义的弹出浮动框-自动消失
- 可以自动消失的弹出提示框
- 弹出选择框的自动消失
- 弹出一个淡入淡出的提示框,且自动消失
- iOS自动消失提示框
- iOS键盘弹出又消失的问题
- ios AlertView弹出框, 慢慢消失
- 安卓开发 弹出对话框,然后自动消失
- iOS中消息框提示的出现与自动消失
- iOS中自动消失提示框的实现
- iOS中自动消失提示框的实现
- EXTJS 弹出很炫的提示框,在规定时间自动消失
- android弹出一会自动消失的消息控件
- sqlite数据库之三---封装好的sql语句的增删查改
- “cout” "endl“: 未声明的标识符”是怎么回事
- ksh 逻辑运算
- 【ZOJ】3430 Detect the Virus AC自动机
- C++ builder 之错误总结:安装第三方控件后,编译报错“Linker Fatal Error Unable To Open File”
- iOS开发- 自动消失的弹出框
- Android应用出错 error: Error retrieving parent for item: No resource found that matches the
- 无法打开包括文件:“iostream.h”: No such file or directory
- jsp运行原理
- 在Qt工程文件中根据不同版本号使用不同源码
- 查询SQL SERVER版本
- MAC OS X系统创建git服务器,支持mac/windows代码
- [Hadoop] 如何为你的企业选择正确的Hadoop版本
- 黑马程序员---交通灯管理系统