2016.1.18个人总结
2016-01-18 22:13
260 查看
记得高中第一节上语文课的时候,语文老师沐浴在和蔼的阳光下告诉我们要”每日进步”.知易行难,虽然现在想起来了但无数宝贵的日子却离我远去了.往者不可谏,来者犹可追.既然现在有一些合适的条件,小小的问题,沿着这条路走下去,也许会峰回路转,柳暗花明?
1.两种语言输出字体
OC:这种可以看出字体的子类
swift:
2.十六进制颜色转换
3.UIVisualEffectView类,给图片添加毛玻璃效果,还挺喜欢的.
UIBlurEffectStyleExtraLight, 模糊高亮
UIBlurEffectStyleLight, 亮色
UIBlurEffectStyleDark 黑色
4.添加pch文件
(1)创建pch文件,如图,注意pch文件应在文件根目录下
![](http://img.blog.csdn.net/20160118220850714)
(2)在Build Settings中搜索pref,如下图
![](http://img.blog.csdn.net/20160118220945268)
(3)添加 金钱符号(SRCROOT)/根目录文件夹名/pch文件名,如我的 金钱符号(SRCROOT)/TestPch/TeshPch.pch
1.两种语言输出字体
OC:这种可以看出字体的子类
[code]for( NSString *familyName in familyNames ){ printf( "Family: %s \n", [familyName UTF8String] ); NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName]; for( NSString *fontName in fontNames ){ printf( "\tFont: %s \n", [fontName UTF8String] ); } }
swift:
[code]let fontFamilies:NSArray=UIFont.familyNames() for (var i = 0; i < fontFamilies.count; i++) { let fontFamily:NSString=fontFamilies[i] as! NSString let fontNames = UIFont.fontNamesForFamilyName(fontFamily as String) print("\n(fontFamily)\t-----\(fontNames)") }
2.十六进制颜色转换
[code]+ (UIColor *)colorFromHexString:(NSString *)hexString { NSString *colorString = [[hexString stringByReplacingOccurrencesOfString: @"#" withString: @""] uppercaseString]; CGFloat alpha, red, blue, green; alpha = 1.0f; red = [self colorComponentFrom: colorString start: 0 length: 2]; green = [self colorComponentFrom: colorString start: 2 length: 2]; blue = [self colorComponentFrom: colorString start: 4 length: 2]; return [UIColor colorWithRed: red green: green blue: blue alpha: alpha]; } + (CGFloat) colorComponentFrom: (NSString *) string start: (NSUInteger) start length: (NSUInteger) length { NSString *substring = [string substringWithRange: NSMakeRange(start, length)]; NSString *fullHex = length == 2 ? substring : [NSString stringWithFormat: @"%@%@", substring, substring]; unsigned hexComponent; [[NSScanner scannerWithString: fullHex] scanHexInt: &hexComponent]; return hexComponent / 255.0; }
3.UIVisualEffectView类,给图片添加毛玻璃效果,还挺喜欢的.
UIBlurEffectStyleExtraLight, 模糊高亮
UIBlurEffectStyleLight, 亮色
UIBlurEffectStyleDark 黑色
[code] UIBlurEffect * blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; UIVisualEffectView * effectView = [[UIVisualEffectView alloc]initWithEffect:blurEffect]; effectView.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height ); [iv2 addSubview:effectView];
4.添加pch文件
(1)创建pch文件,如图,注意pch文件应在文件根目录下
(2)在Build Settings中搜索pref,如下图
(3)添加 金钱符号(SRCROOT)/根目录文件夹名/pch文件名,如我的 金钱符号(SRCROOT)/TestPch/TeshPch.pch
相关文章推荐