1
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
//
|
||||
|
||||
#import "KBSkinDetailHeaderCell.h"
|
||||
#import "UIImageView+KBWebImage.h"
|
||||
#import "KBShopThemeDetailModel.h"
|
||||
|
||||
@implementation KBSkinDetailHeaderCell
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
@@ -37,12 +39,18 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)configWithTitle:(NSString *)title right:(NSString *)right {
|
||||
// 演示:标题/下载量文案
|
||||
self.leftLabel.text = title.length ? title : @"Dopamine";
|
||||
self.rightLabel.text = right.length ? right : @"Download: 1 Million";
|
||||
// 本示例不做网络图,直接用占位背景色
|
||||
self.coverView.backgroundColor = [UIColor colorWithWhite:0.94 alpha:1.0];
|
||||
- (void)configWithDetail:(KBShopThemeDetailModel *)detail {
|
||||
NSString *title = detail.themeName.length ? detail.themeName : @"Dopamine";
|
||||
NSString *download = detail.themeDownload.length ? detail.themeDownload : @"0";
|
||||
NSString *downloadText = [NSString stringWithFormat:@"%@: %@", KBLocalized(@"Download"), download];
|
||||
self.leftLabel.text = title;
|
||||
self.rightLabel.text = downloadText;
|
||||
UIImage *placeholder = [UIImage imageNamed:@"shop_headbigBg_icon"];
|
||||
if (detail.themePreviewImageUrl.length) {
|
||||
[self.coverView kb_setImageURL:detail.themePreviewImageUrl placeholder:placeholder];
|
||||
} else {
|
||||
self.coverView.image = placeholder;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Lazy
|
||||
@@ -51,6 +59,7 @@
|
||||
_coverView = [[UIImageView alloc] init];
|
||||
_coverView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_coverView.clipsToBounds = YES;
|
||||
_coverView.layer.cornerRadius = 12;
|
||||
}
|
||||
return _coverView;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user