JXTelAreaCell.m 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // JXTelAreaCell.m
  3. // shiku_im
  4. //
  5. // Created by MacZ on 16/7/7.
  6. // Copyright © 2016年 Reese. All rights reserved.
  7. //
  8. #import "JXTelAreaCell.h"
  9. #import "JXMyTools.h"
  10. @implementation JXTelAreaCell
  11. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  12. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  13. if (self) {
  14. //国家名
  15. _countryName = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, JX_SCREEN_WIDTH-15-15-15-50, TELAREA_CELL_HEIGHT)];
  16. _countryName.font = SYSFONT(15);
  17. _countryName.text = @"";
  18. [self.contentView addSubview:_countryName];
  19. // [_countryName release];
  20. // _countryName.backgroundColor = [UIColor orangeColor];
  21. //区号
  22. _areaNum = [[UILabel alloc] initWithFrame:CGRectMake(JX_SCREEN_WIDTH-15-50, 0, 50, TELAREA_CELL_HEIGHT)];
  23. _areaNum.text = @"+1896";
  24. _areaNum.font = SYSFONT(14);
  25. _areaNum.textAlignment = NSTextAlignmentRight;
  26. [self.contentView addSubview:_areaNum];
  27. // [_areaNum release];
  28. // _areaNum.backgroundColor = [UIColor magentaColor];
  29. //下划线
  30. _bottomLine = [JXMyTools bottomLineWithFrame:CGRectMake(15, TELAREA_CELL_HEIGHT-LINE_WH, JX_SCREEN_WIDTH-15*2, LINE_WH)];
  31. [self.contentView addSubview:_bottomLine];
  32. // [_bottomLine release];
  33. }
  34. return self;
  35. }
  36. - (void)doRefreshWith:(NSDictionary *)dict language:(NSString *)language{
  37. if ([language isEqualToString:@"zh"]) {
  38. _countryName.text = [dict objectForKey:@"country"];
  39. }else if ([language isEqualToString:@"big5"]) {
  40. _countryName.text = [dict objectForKey:@"big5"];
  41. }else{
  42. _countryName.text = [dict objectForKey:@"enName"];
  43. }
  44. _areaNum.text = [NSString stringWithFormat:@"+%@",[dict objectForKey:@"prefix"]];
  45. }
  46. - (void)awakeFromNib {
  47. [super awakeFromNib];
  48. // Initialization code
  49. }
  50. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  51. [super setSelected:selected animated:animated];
  52. // Configure the view for the selected state
  53. }
  54. @end