TTTAttributedLabelUILabel 改进版
TTTAttributedLabel 是 UILable 的改进,支持 NSAttributedStrings。
示例代码:
TTTAttributedLabel *label = [[[TTTAttributedLabel alloc] initWithFrame:CGRectZero] autorelease]; label.font = [UIFont systemFontOfSize:14]; label.textColor = [UIColor darkGrayColor]; label.lineBreakMode = UILineBreakModeWordWrap; label.numberOfLines = 0; NSString *text = @"Lorem ipsum dolar sit amet"; [label setText:text afterInheritingLabelAttributesAndConfiguringWithBlock:^ NSAttributedString *(NSMutableAttributedString *mutableAttributedString) { NSRange boldRange = [[mutableAttributedString string] rangeOfString:@"ipsum dolar" options:NSCaseInsensitiveSearch]; NSRange strikeRange = [[mutableAttributedString string] rangeOfString:@"sit amet" options:NSCaseInsensitiveSearch]; // Core Text APIs use C functions without a direct bridge to UIFont. See Apple's "Core Text Programming Guide" to learn how to configure string attributes. UIFont *boldSystemFont = [UIFont boldSystemFontOfSize:14]; CTFontRef font = CTFontCreateWithName((CFStringRef)boldSystemFont.fontName, boldSystemFont.pointSize, NULL); if (font) { [mutableAttributedString addAttribute:(NSString *)kCTFontAttributeName value:(id)font range:boldRange]; [mutableAttributedString addAttribute:@"TTTCustomStrikeOut" value:[NSNumber numberWithBool:YES] range:strikeRange]; CFRelease(font); } return mutableAttributedString; }];
评论
TTTAttributedLabelUILabel 改进版
TTTAttributedLabel是UILable的改进,支持NSAttributedStrings。示例代码:TTTAttributedLabel*label=[[[TTTAttributedLa
TTTAttributedLabelUILabel 改进版
0
pwgetwget 改进版
pwget是wget的替代品,可使用递归方式下载正则表单式匹配的所有URL地址。使用方法:./pwget.py[-rurl_regex]url1[url2]...[urln]Options:-v--v
pwgetwget 改进版
0
JSON5JSON 改进版
JSON是很严格的,主键必须在引号中,字符串必须用双引号,对象和数组不能有逗号结尾,不能有注释。这些在过去都是必须的,但是随着支持ECMAScript5的浏览器引擎的出现,例如V8,这些限制就显得很臃
JSON5JSON 改进版
0
piotopiotop 改进版
piotop其实就是iotop,只是在其上面,自己添加了一个小功能。如果你知道有程序在磨你的硬盘,但是你又不能确定是哪一个程序在磨你的硬盘,那么就用iotop来帮助你吧。由于官方的-p参数不支持进程名
piotopiotop 改进版
0