Commit efed3d62e954bb6885ab066d7dffc550fe4e4106
1 parent
da8f31b8
no message
Showing
5 changed files
with
60 additions
and
68 deletions
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCMoreProgramViewController.m
| ... | ... | @@ -145,7 +145,6 @@ |
| 145 | 145 | _tableView.showsVerticalScrollIndicator = NO; |
| 146 | 146 | _tableView.delegate = self; |
| 147 | 147 | _tableView.dataSource = self; |
| 148 | - // _tableView.rowHeight = 98; | |
| 149 | 148 | _tableView.backgroundColor = [UIColor clearColor]; |
| 150 | 149 | _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; |
| 151 | 150 | _tableView.header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(refreshAction)]; | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/View/LVCHeaderRollCollectionViewCell.m
| ... | ... | @@ -10,40 +10,40 @@ |
| 10 | 10 | |
| 11 | 11 | @interface LVCHeaderRollCollectionViewCell () |
| 12 | 12 | |
| 13 | -@property (nonatomic, weak) UIImageView *imageView; | |
| 13 | +@property (nonatomic, strong) UIImageView *imageView; | |
| 14 | 14 | |
| 15 | 15 | @end |
| 16 | 16 | |
| 17 | 17 | @implementation LVCHeaderRollCollectionViewCell |
| 18 | 18 | |
| 19 | -#pragma mark - 构造函数 | |
| 20 | 19 | - (instancetype)initWithFrame:(CGRect)frame |
| 21 | 20 | { |
| 22 | 21 | self = [super initWithFrame:frame]; |
| 23 | 22 | if (self) { |
| 24 | - [self setupUI]; | |
| 23 | + | |
| 24 | + [self.contentView addSubview:self.imageView]; | |
| 25 | + | |
| 25 | 26 | } |
| 26 | 27 | return self; |
| 27 | 28 | } |
| 28 | 29 | |
| 29 | -#pragma mark - 设置数据 | |
| 30 | +#pragma mark - | |
| 31 | +#pragma mark - setter | |
| 30 | 32 | - (void)setImageUrl:(NSURL *)imageUrl { |
| 31 | 33 | _imageUrl = imageUrl; |
| 32 | - | |
| 33 | - [_imageView sd_setImageWithURL:imageUrl placeholderImage:[UIImage imageNamed:@"频道页—轮播图"]]; | |
| 34 | + [_imageView sd_setImageWithURL:imageUrl placeholderImage:[UIImage imageNamed:@"load_03"]]; | |
| 34 | 35 | } |
| 35 | 36 | |
| 36 | -#pragma mark - 设置轮播cell界面 | |
| 37 | -- (void)setupUI | |
| 38 | -{ | |
| 39 | - UIImageView *iv = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-20, (SCREEN_WIDTH-20)/2)]; | |
| 40 | - iv.backgroundColor = [UIColor whiteColor]; | |
| 41 | - iv.contentMode = UIViewContentModeScaleToFill; | |
| 42 | - [self.contentView addSubview:iv]; | |
| 43 | - | |
| 44 | - _imageView = iv; | |
| 37 | +#pragma mark - | |
| 38 | +#pragma mark - gstter | |
| 39 | +- (UIImageView *)imageView | |
| 40 | +{ | |
| 41 | + if (!_imageView) { | |
| 42 | + _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-20, (SCREEN_WIDTH-20)/2)]; | |
| 43 | + _imageView.backgroundColor = [UIColor whiteColor]; | |
| 44 | + _imageView.contentMode = UIViewContentModeScaleToFill; | |
| 45 | + } | |
| 46 | + return _imageView; | |
| 45 | 47 | } |
| 46 | 48 | |
| 47 | - | |
| 48 | - | |
| 49 | 49 | @end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/View/LVCLiveListCollectionViewCell.m
| ... | ... | @@ -21,13 +21,16 @@ |
| 21 | 21 | |
| 22 | 22 | @implementation LVCLiveListCollectionViewCell |
| 23 | 23 | |
| 24 | -#pragma mark - 构造函数 | |
| 25 | 24 | - (instancetype)initWithFrame:(CGRect)frame |
| 26 | 25 | { |
| 27 | 26 | self = [super initWithFrame:frame]; |
| 28 | 27 | if (self) { |
| 29 | - self.backgroundColor = [UIColor yellowColorZX]; | |
| 30 | - [self setupUI]; | |
| 28 | + | |
| 29 | + self.contentView.backgroundColor = [UIColor whiteColor]; | |
| 30 | + [self.contentView addSubview:self.image]; | |
| 31 | + [self.contentView addSubview:self.title]; | |
| 32 | + [self.contentView addSubview:self.detail]; | |
| 33 | + | |
| 31 | 34 | } |
| 32 | 35 | return self; |
| 33 | 36 | } |
| ... | ... | @@ -38,17 +41,19 @@ |
| 38 | 41 | self.detail.font = [UIFont systemFontOfSize:12]; |
| 39 | 42 | self.title.text = [NSString stringWithFormat:@"正在直播:%@", details.currentPlay]; |
| 40 | 43 | self.detail.text = [NSString stringWithFormat:@"即将直播:%@", details.nextPlay]; |
| 41 | - [self.image sd_setImageWithURL:[NSURL URLWithString:details.img] placeholderImage:[UIImage imageNamed:@"频道页占位符"]]; | |
| 42 | - self.image.contentMode = UIViewContentModeScaleAspectFill; | |
| 43 | - self.image.clipsToBounds = YES; | |
| 44 | + [self.image sd_setImageWithURL:[NSURL URLWithString:details.img] placeholderImage:[UIImage imageNamed:@"load_03"]]; | |
| 45 | + | |
| 44 | 46 | } |
| 45 | 47 | |
| 46 | -#pragma mark - 懒加载 | |
| 48 | +#pragma mark - | |
| 49 | +#pragma mark - getter | |
| 47 | 50 | - (UIImageView *)image |
| 48 | 51 | { |
| 49 | 52 | if (!_image) { |
| 50 | 53 | _image = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.width, (self.contentView.width)*H_Cell_Ratio)]; |
| 51 | 54 | _image.backgroundColor = [UIColor grayColor]; |
| 55 | + _image.contentMode = UIViewContentModeScaleAspectFill; | |
| 56 | + _image.clipsToBounds = YES; | |
| 52 | 57 | } |
| 53 | 58 | return _image; |
| 54 | 59 | } |
| ... | ... | @@ -73,13 +78,4 @@ |
| 73 | 78 | return _detail; |
| 74 | 79 | } |
| 75 | 80 | |
| 76 | -#pragma mark - 设置cell | |
| 77 | -- (void)setupUI { | |
| 78 | - | |
| 79 | - self.contentView.backgroundColor = [UIColor whiteColor]; | |
| 80 | - [self.contentView addSubview:self.image]; | |
| 81 | - [self.contentView addSubview:self.title]; | |
| 82 | - [self.contentView addSubview:self.detail]; | |
| 83 | -} | |
| 84 | - | |
| 85 | 81 | @end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/View/LVCOtherHeaderReusableView.m
| ... | ... | @@ -23,17 +23,39 @@ |
| 23 | 23 | { |
| 24 | 24 | self = [super initWithFrame:frame]; |
| 25 | 25 | if (self) { |
| 26 | - [self setupUI]; | |
| 26 | + | |
| 27 | + self.backgroundColor = [UIColor whiteColor]; | |
| 28 | + | |
| 29 | + UIView *intervalView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, 6)]; | |
| 30 | + intervalView.backgroundColor = [UIColor backgroundColorZX]; | |
| 31 | + [self addSubview:intervalView]; | |
| 32 | + [self addSubview:self.button]; | |
| 33 | + [self addSubview:self.arrow]; | |
| 34 | + | |
| 27 | 35 | } |
| 28 | 36 | return self; |
| 29 | 37 | } |
| 30 | 38 | |
| 39 | +#pragma mark - | |
| 40 | +#pragma mark - Action | |
| 41 | +- (void)buttonAction | |
| 42 | +{ | |
| 43 | + LVCMoreProgramViewController *more = [[LVCMoreProgramViewController alloc]init]; | |
| 44 | + more.cid = _model.cid; | |
| 45 | + more.title = _model.title; | |
| 46 | + [self.viewController.navigationController pushViewController:more animated:YES]; | |
| 47 | +} | |
| 48 | + | |
| 49 | +#pragma mark - | |
| 50 | +#pragma mark - setter | |
| 31 | 51 | - (void)setModel:(LVCChannelsModel *)model { |
| 32 | 52 | |
| 33 | 53 | _model = model; |
| 34 | 54 | [self.button setTitle:[NSString stringWithFormat:@" %@", model.title] forState:UIControlStateNormal]; |
| 35 | 55 | } |
| 36 | 56 | |
| 57 | +#pragma mark - | |
| 58 | +#pragma mark - gatter | |
| 37 | 59 | - (UIButton *)button |
| 38 | 60 | { |
| 39 | 61 | if (!_button) { |
| ... | ... | @@ -56,30 +78,4 @@ |
| 56 | 78 | return _arrow; |
| 57 | 79 | } |
| 58 | 80 | |
| 59 | -#pragma mark - Action | |
| 60 | -- (void)buttonAction | |
| 61 | -{ | |
| 62 | - LVCMoreProgramViewController *more = [[LVCMoreProgramViewController alloc]init]; | |
| 63 | - more.cid = _model.cid; | |
| 64 | - more.title = _model.title; | |
| 65 | - [self.viewController.navigationController pushViewController:more animated:YES]; | |
| 66 | -} | |
| 67 | - | |
| 68 | -#pragma mark - 设置组头界面 | |
| 69 | -- (void)setupUI | |
| 70 | -{ | |
| 71 | - | |
| 72 | - self.backgroundColor = [UIColor whiteColor]; | |
| 73 | - | |
| 74 | - UIView *intervalView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, 6)]; | |
| 75 | - intervalView.backgroundColor = [UIColor backgroundColorZX]; | |
| 76 | - [self addSubview:intervalView]; | |
| 77 | - | |
| 78 | - [self addSubview:self.button]; | |
| 79 | - | |
| 80 | - [self addSubview:self.arrow]; | |
| 81 | -} | |
| 82 | - | |
| 83 | - | |
| 84 | - | |
| 85 | 81 | @end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/View/LVCTelevisionView.m
| ... | ... | @@ -24,16 +24,16 @@ static NSString *otherHeaderId = @"LVCOtherHeaderReusableView"; |
| 24 | 24 | NSTimer *_autoRefreshTimer; |
| 25 | 25 | CGFloat _refreshTime; |
| 26 | 26 | NSNotification *_liveNotification; |
| 27 | - BOOL _adImageHidden; //开机广告或引导页是否显示完毕 | |
| 27 | + BOOL _adImageHidden; //开机广告或引导页是否显示完毕 | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | @property (nonatomic, strong) UICollectionView *collectionView; |
| 31 | 31 | @property (nonatomic, strong) NSArray *bannerModelArray; //banner数据源 |
| 32 | 32 | @property (nonatomic, strong) NSArray *marqueeModelArray; // |
| 33 | 33 | @property (nonatomic, strong) NSArray *channelsModelArray; // |
| 34 | -@property (nonatomic, strong) UIButton *reloadBtn; // 刷新按钮 | |
| 35 | -@property (nonatomic, strong) UILabel *reloadLab; // 刷新提示文字 | |
| 36 | -@property (nonatomic, strong) UIImageView *reloadImg; //刷新图片 | |
| 34 | +@property (nonatomic, strong) UIButton *reloadBtn; // 刷新按钮 | |
| 35 | +@property (nonatomic, strong) UILabel *reloadLab; // 刷新提示文字 | |
| 36 | +@property (nonatomic, strong) UIImageView *reloadImg; //刷新图片 | |
| 37 | 37 | |
| 38 | 38 | @end |
| 39 | 39 | |
| ... | ... | @@ -61,6 +61,7 @@ static NSString *otherHeaderId = @"LVCOtherHeaderReusableView"; |
| 61 | 61 | return self; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | +#pragma mark - | |
| 64 | 65 | #pragma mark - action |
| 65 | 66 | - (void)reloadBtnAction |
| 66 | 67 | { |
| ... | ... | @@ -100,6 +101,7 @@ static NSString *otherHeaderId = @"LVCOtherHeaderReusableView"; |
| 100 | 101 | _autoRefreshTimer = nil; |
| 101 | 102 | } |
| 102 | 103 | |
| 104 | +#pragma mark - | |
| 103 | 105 | #pragma mark - UICollectionViewDataSource |
| 104 | 106 | - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { |
| 105 | 107 | if (self.channelsModelArray.count > 0) { |
| ... | ... | @@ -181,14 +183,14 @@ static NSString *otherHeaderId = @"LVCOtherHeaderReusableView"; |
| 181 | 183 | } |
| 182 | 184 | } |
| 183 | 185 | |
| 186 | +#pragma mark - | |
| 184 | 187 | #pragma mark - UICollectionViewDelegate |
| 185 | 188 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { |
| 186 | 189 | NSLog(@"跳转-----"); |
| 187 | 190 | |
| 188 | 191 | } |
| 189 | 192 | |
| 190 | - | |
| 191 | - | |
| 193 | +#pragma mark - | |
| 192 | 194 | #pragma mark - 加载数据 |
| 193 | 195 | - (void)loadData { |
| 194 | 196 | |
| ... | ... | @@ -249,7 +251,6 @@ static NSString *otherHeaderId = @"LVCOtherHeaderReusableView"; |
| 249 | 251 | return stamp; |
| 250 | 252 | } |
| 251 | 253 | |
| 252 | - | |
| 253 | 254 | #pragma mark - |
| 254 | 255 | #pragma mark - getter |
| 255 | 256 | - (UICollectionView *)collectionView { | ... | ... |