IOS指示器
2015-06-14 00:34
621 查看
使用的控件是UILabel,由于一开始是隐藏的将alpha属性设置为0,一般提示出来的东西背景色半透明,
capcity选择百分之50使 背景色半透明
隐藏的方式:alpha属性设置为0
色彩搭配:
字体白色,背景黑色
指示器显示完要自动隐藏
/* 定时器三种方法 */
// 1. performSelector 设置延时时间:2.0秒之后调用self的hidHud方法
[self performSelector:@selector(hidHud:) withObject:@"hahaha"afterDelay:2.0];
// 2. dispatch_after 相比第一种少了一个方法
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// 使Hud全透明
NSLog(@"dispatch_after");
self.HUD.alpha = 0.0;
});
// 3. 系统专用定时器
[NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(hidHud:) userInfo:@"hahaha" repeats:NO];
- (void)hidHud:(NSString *)testStr
{
NSLog(@"hide!%@",testStr);
self.HUD.alpha = 0.0;
}
plist文件的创建可以拷贝的 不用每次都点击加号
capcity选择百分之50使 背景色半透明
隐藏的方式:alpha属性设置为0
色彩搭配:
字体白色,背景黑色
指示器显示完要自动隐藏
/* 定时器三种方法 */
// 1. performSelector 设置延时时间:2.0秒之后调用self的hidHud方法
[self performSelector:@selector(hidHud:) withObject:@"hahaha"afterDelay:2.0];
// 2. dispatch_after 相比第一种少了一个方法
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// 使Hud全透明
NSLog(@"dispatch_after");
self.HUD.alpha = 0.0;
});
// 3. 系统专用定时器
[NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(hidHud:) userInfo:@"hahaha" repeats:NO];
- (void)hidHud:(NSString *)testStr
{
NSLog(@"hide!%@",testStr);
self.HUD.alpha = 0.0;
}
plist文件的创建可以拷贝的 不用每次都点击加号
相关文章推荐
- iOS系统 查看序列号
- xcode armv6 armv7 armv7s arm64指令集
- ios自用学习笔记一委托协议的简单了解
- ios开发 数据存储
- GPS坐标转换为百度坐标的方法总结——IOS篇
- iOS---block的详细用法
- iOS7 Programming Cookbook笔记
- iOS发送验证码倒计时功能的实现
- iOS调节系统音量
- iOS开发--@property属性的使用
- IOS笔记047-代理传值和block传值
- IOS笔记047-代理传值和block传值
- torch-ios框架XCODE使用备忘
- iOS判断字符串是否符合格式要求
- ios获取当前年月日和星期
- iOS汉字识别改进算法
- iOS Widget简单使用
- iOS多线程编程之NSThread的使用
- IOS 四种保存数据的方式
- [iOS]Error Domain=NSURLErrorDomain Code=-1005 “The network connection was lost.”