2018年11月15日

iOS 获取 UILabel 的宽度

摘要: 1 /** 2 * 获取高度 3 * 4 * @param font 目标字体 5 * @param width 约束宽度 6 * 7 * @return 目标高度 8 */ 9 - (CGFloat)ptv_heightWithFont:(UIFont *)font constrainedToWidth:(CGFloat)width { 10 ... 阅读全文

posted @ 2018-11-15 17:27 活最好的自己 阅读(185) 评论(0) 推荐(0) 编辑

iOS 获取 UILabel串的宽度

摘要: 1 /** 2 * 获取高度 3 * 4 * @param font 目标字体 5 * @param width 约束宽度 6 * 7 * @return 目标高度 8 */ 9 - (CGFloat)ptv_heightWithFont:(UIFont *)font constrainedToWidth:(CGFloat)width { 10 ... 阅读全文

posted @ 2018-11-15 17:27 活最好的自己 阅读(778) 评论(0) 推荐(0) 编辑

iOS 十六进制字符串 "#FFFF00" 转换成颜色对象

摘要: 1 + (UIColor *)colorWithHexStr:(NSString *)hexString { 2 NSString *colorString = [[hexString stringByReplacingOccurrencesOfString:@"#" withString:@""] uppercaseString]; 3 CGFloat alpha, re... 阅读全文

posted @ 2018-11-15 16:57 活最好的自己 阅读(1960) 评论(0) 推荐(0) 编辑

导航