Commit 192a658ffd603f4692e292b3d3f64fd39add4bd0

Authored by yanglingyu
1 parent a44cafa0

背景色设置

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