SHomeInfoV.m 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //
  2. // SHomeInfoV.m
  3. // BuguLive
  4. //
  5. // Created by 丁凯 on 2017/8/26.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. #import "SHomeInfoV.h"
  9. @implementation SHomeInfoV
  10. - (instancetype)initWithFrame:(CGRect)frame
  11. {
  12. self = [super initWithFrame:frame];
  13. if (self)
  14. {
  15. self.backgroundColor = kBackGroundColor;
  16. }
  17. return self;
  18. }
  19. - (void)setViewWithArray:(NSArray *)otherArray andMDict:(NSMutableDictionary *)Mdict
  20. {
  21. for (UIView *subView in self.subviews)
  22. {
  23. [subView removeFromSuperview];
  24. }
  25. @autoreleasepool
  26. {
  27. CGFloat viewHeight = 30;
  28. for (int i = 0; i < otherArray.count; i ++)
  29. {
  30. UIView *whiteBottomView = [[UIView alloc]initWithFrame:CGRectMake(0, viewHeight*i, kScreenW, viewHeight)];
  31. whiteBottomView.backgroundColor = kWhiteColor;
  32. [self addSubview:whiteBottomView];
  33. NSDictionary *dict = otherArray[i];
  34. NSString *keyString = dict.allKeys.firstObject;
  35. NSString *valueString = dict.allValues.firstObject;
  36. UILabel *keyKabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 0, kScreenW - 100, viewHeight)];
  37. keyKabel.backgroundColor = [UIColor clearColor];
  38. keyKabel.text = [NSString stringWithFormat:@"%@:%@",keyString,valueString];
  39. keyKabel.textColor = [UIColor colorWithHexString:@"#666666"];
  40. keyKabel.textAlignment = NSTextAlignmentLeft;
  41. keyKabel.font = [UIFont systemFontOfSize:13];
  42. [whiteBottomView addSubview:keyKabel];
  43. // UILabel *valueKabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenW*0.3+10, 0, kScreenW*0.7-20, 30)];
  44. // valueKabel.backgroundColor = [UIColor clearColor];
  45. // valueKabel.text = [NSString stringWithFormat:@"%@",valueString];
  46. // valueKabel.textColor = kAppGrayColor4;
  47. // valueKabel.textAlignment = NSTextAlignmentRight;
  48. // valueKabel.font = [UIFont systemFontOfSize:13];
  49. // [whiteBottomView addSubview:valueKabel];
  50. if (i < otherArray.count-1)
  51. {
  52. UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(10, viewHeight, kScreenW-10, 1)];
  53. lineView.backgroundColor = kAppSpaceColor4;
  54. [whiteBottomView addSubview:lineView];
  55. }
  56. }
  57. }
  58. }
  59. @end