状态栏弹出提示框代码
来源:互联网 发布:杭州美工招聘信息 编辑:程序博客网 时间:2024/05/18 21:48
-(void)postStatusBarNotice:(NSString *)info duration:(NSTimeInterval)time{
statusWin=[[UIWindowalloc] initWithFrame:CGRectMake(0, 0, 320, 20)];
[statusWinsetWindowLevel:UIWindowLevelAlert];
msgLabel=[[UILabelalloc]initWithFrame:statusWin.frame];
msgLabel.text=info;
msgLabel.backgroundColor=[UIColorblackColor];
msgLabel.textColor=[UIColorwhiteColor];
msgLabel.textAlignment=UITextAlignmentCenter;
msgLabel.font=[UIFontsystemFontOfSize:12];
msgLabel.alpha=0.7;
[statusWin addSubview:msgLabel];
[statusWinmakeKeyAndVisible];
AppDelegate *appDelegate=(AppDelegate *)[UIApplicationsharedApplication].delegate;
[appDelegate.windowmakeKeyAndVisible];
[UIViewbeginAnimations:nilcontext:nil];
[UIViewsetAnimationDuration:time];
[UIViewsetAnimationCurve:UIViewAnimationCurveEaseOut];
[UIViewsetAnimationDelegate:self];
[UIViewsetAnimationDidStopSelector:@selector(hideCustomStatusBar)];
msgLabel.alpha=1;
[UIViewcommitAnimations];
}
-(void)hideCustomStatusBar{
[UIViewanimateWithDuration:.3 animations:^{
msgLabel.transform=CGAffineTransformMakeTranslation(320, 0);
}completion:^(BOOL finished){
[msgLabelrelease];
CFShow(statusWin);
[statusWin release];
statusWin = nil;
}];
- 状态栏弹出提示框代码
- 更新数据后弹出提示框代码
- 代码片段——弹出提示框
- 弹出框和提示框效果以及代码展示
- asp.net 后台代码跳转页面前弹出提示框
- jquery右下角弹出提示框的实现代码
- asp.net web应用程序后台弹出提示框代码
- js 刷新父页面不弹出提示框的代码
- Java Swing 弹出退出提示框(代码示例)
- android系统中常用的弹出提示框使用代码
- 点击按钮Alert弹出遮罩层效果的提示框代码
- 自动弹出提示框
- POPHint 弹出提示框
- POPHint 弹出提示框
- winfrom弹出提示框
- 点击弹出提示框
- js弹出提示框
- 弹出自定义提示框
- Box2D例子——Demo1掉落的小球
- Next Permutation[leetcode]
- HDU_4122_Alice's mooncake shop(单调队列)
- Java Socket实战之七 使用Socket通信传输文件
- vsgfghg
- 状态栏弹出提示框代码
- select()函数以及FD_ZERO、FD_SET、FD_CLR、FD_ISSET
- activeMq 入门教程
- OpenGL__简单实例(附加glut的配置)
- IOS_XCODE6_beta7(An error was encountered while running (Domain = NSPOSIXErrorDomain, Code = 22)
- oc内存管理
- Sheets集合与Worksheets集合的区别
- Gson的使用
- 如何在Android应用中使用百度地图api