Commit 192a658ffd603f4692e292b3d3f64fd39add4bd0

Authored by yanglingyu
1 parent a44cafa0

背景色设置

CNLiveVideoClassifyKit/Classes/ClassifyCategory/Controller/CNLiveSubSegmentController.m
... ... @@ -71,11 +71,11 @@
71 71  
72 72 - (void)viewDidLoad {
73 73 [super viewDidLoad];
74   -
  74 + // 如果后台传了背景图 就设置背景图
  75 + [self.view addSubview:self.bgImgView];
  76 + [self.view sendSubviewToBack:self.bgImgView];
75 77 if (!CNLiveStringIsEmpty(self.backImageH5)) {
76   - // 如果后台传了背景图 就设置背景图
77   - [self.view addSubview:self.bgImgView];
78   - [self.view sendSubviewToBack:self.bgImgView];
  78 +
79 79 weakself
80 80 [self.bgImgView sd_setImageWithURL:[NSURL URLWithString:self.backImageH5] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
81 81 if (image) {
... ... @@ -86,6 +86,10 @@
86 86 }
87 87 }
88 88 }];
  89 + }else{
  90 + if (CNLiveStringIsEmpty(self.backImage)) {
  91 + self.bgImgView.backgroundColor = CNLiveColorWithHexString(self.backgroundColor);
  92 + }
89 93 }
90 94 [self handleDateWithChannelsArray];
91 95 if ([CNWebRedirectHandle manager].isClickedIntegral) {
... ... @@ -109,9 +113,7 @@
109 113  
110 114 self.view.backgroundColor = [UIColor clearColor];
111 115 self.myCategoryView.titles = self.titles;
112   - if (CNLiveStringIsEmpty(self.backImage)) {
113   - self.view.backgroundColor = CNLiveColorWithHexString(self.backgroundColor);
114   - }
  116 +
115 117 self.myCategoryView.titleColor = self.textColor;
116 118 self.myCategoryView.titleSelectedColor = self.textColor;
117 119 self.myCategoryView.cellSpacing = 32;
... ...