用于某些货币类型的带有attributedString格式的价格工具,包含/USD / EUR / CNY / GRP
使用cocoapods
pod 'LPPriceAttributedStringLabel', '~> 1.0.0'
手动
just download & drag into your prj
有许多属性用于自定义,可参考示例项目或源代码
LPPriceAttributedStringLabel *al1 = [[LPPriceAttributedStringLabel alloc] init];
al1.frame = CGRectMake(50, 200, self.view.frame.size.width, 50);
al1.moneyType = LPMoneyTypeUSD;//USD / EUR / CNY / GRP
al1.integerStringFont = [UIFont systemFontOfSize:30.f];
al1.decimalStringFont = [UIFont systemFontOfSize:18.f];
al1.integerStringFontColor = [UIColor redColor];
al1.decimalStringFontColor = [UIColor purpleColor];
al1.moneyTypeStringFont = [UIFont systemFontOfSize:15.f];
al1.moneyTypeStringFontColor = [UIColor greenColor];
al1.text = @"998.00";