SuctionMoneyCell.m 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // SuctionMoneyCell.m
  3. // BuguLive
  4. //
  5. // Created by fanwe2014 on 16/8/10.
  6. // Copyright © 2016年 xfg. All rights reserved.
  7. //
  8. #import "SuctionMoneyCell.h"
  9. @implementation SuctionMoneyCell
  10. - (void)awakeFromNib
  11. {
  12. [super awakeFromNib];
  13. self.BuguLive = [GlobalVariables sharedInstance];
  14. self.nameLabel.textColor = kAppGrayColor1;
  15. self.lineView = [[UIView alloc]initWithFrame:CGRectMake(10, self.frame.size.height-1, kScreenW-10, 1)];
  16. self.lineView.backgroundColor = kAppSpaceColor4;
  17. [self addSubview:self.lineView];
  18. }
  19. - (void)setCellWithMoney:(NSString *)money
  20. {
  21. NSString *moneyString;
  22. if ([money intValue] > 1000)
  23. {
  24. moneyString = [NSString stringWithFormat:ASLocalizedString(@"%.2fK"),[money floatValue]/1000];
  25. }else
  26. {
  27. moneyString = money;
  28. }
  29. NSString *string = [NSString stringWithFormat:ASLocalizedString(@"系统将在您的账户中扣取%@%@作为拍卖保证金暂时托管。"),moneyString,self.BuguLive.appModel.diamond_name];
  30. NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:string];
  31. [attr setAttributes:@{NSFontAttributeName : [UIFont systemFontOfSize:14.0]} range:NSMakeRange(0, moneyString.length)];
  32. // [attr setAttributes:@{NSForegroundColorAttributeName : kAppMainColor} range:[string rangeOfString:moneyString]]; //设置会员名称的字体颜色
  33. self.nameLabel.attributedText = attr;
  34. }
  35. @end