Commit 6d71e73898da4559593a397d82ba2b48bd18f71a
1 parent
bb90d759
增加首页按钮宽度
Showing
2 changed files
with
14 additions
and
6 deletions
CNLiveCServiceModule/Classes/Present/CNLiveServicePresent.m
| ... | ... | @@ -101,7 +101,7 @@ static const CGFloat margin = 15; |
| 101 | 101 | if (model.categories.count <= 4) { |
| 102 | 102 | cellheight = 80; |
| 103 | 103 | } |
| 104 | - categoryModel = [CNLiveServicePresent dealDataSource:model.categories title:@"" subtitle:@"" cellHeight:cellheight itemSize:CGSizeMake((SCREEN_WIDTH-4*margin-3*margin)/4.0, 70)showNum:8]; | |
| 104 | + categoryModel = [CNLiveServicePresent dealDataSource:model.categories title:@"" subtitle:@"" cellHeight:cellheight itemSize:CGSizeMake((SCREEN_WIDTH-2*margin)/4.0, 70)showNum:8]; | |
| 105 | 105 | if (categoryModel) { |
| 106 | 106 | [dataArray addObject:categoryModel]; |
| 107 | 107 | } |
| ... | ... | @@ -126,18 +126,18 @@ static const CGFloat margin = 15; |
| 126 | 126 | cellheight = 90; |
| 127 | 127 | } |
| 128 | 128 | showNum = 4; |
| 129 | - itemSize = CGSizeMake((KScreenWidth - 3*margin -10)/2, 60); | |
| 129 | + itemSize = CGSizeMake((KScreenWidth - 3*margin)/2, 60); | |
| 130 | 130 | }else if ([dic[@"name"] isEqualToString:@"中国媒体号"] || [dic[@"name"] isEqualToString:@"中国网中国号"]) { |
| 131 | 131 | cellheight = 190; |
| 132 | 132 | if (lists.count <= 4) { |
| 133 | 133 | cellheight = 105; |
| 134 | 134 | } |
| 135 | 135 | showNum = 8; |
| 136 | - itemSize = CGSizeMake((SCREEN_WIDTH-4*margin-3*margin)/4.0, 70); | |
| 136 | + itemSize = CGSizeMake((SCREEN_WIDTH-2*margin)/4.0, 70); | |
| 137 | 137 | }else{ |
| 138 | 138 | cellheight = 125; |
| 139 | 139 | showNum = 4; |
| 140 | - itemSize = CGSizeMake((SCREEN_WIDTH-4*margin-3*margin)/4.0, 70); | |
| 140 | + itemSize = CGSizeMake((SCREEN_WIDTH-2*margin)/4.0, 70); | |
| 141 | 141 | subTitle = dic[@"category"][@"subTitle"]; |
| 142 | 142 | } |
| 143 | 143 | if (lists &&[lists isKindOfClass:[NSArray class]] && lists.count > 0) { | ... | ... |
CNLiveCServiceModule/Classes/View/CNLiveCycleCell.m
| ... | ... | @@ -13,7 +13,7 @@ |
| 13 | 13 | #import "CNLiveChineServiceCell.h" |
| 14 | 14 | #import "CNLiveServiceOrLookCell.h" |
| 15 | 15 | |
| 16 | -@interface CNLiveCycleCell()<UICollectionViewDelegate,UICollectionViewDataSource> | |
| 16 | +@interface CNLiveCycleCell()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout> | |
| 17 | 17 | @property (nonatomic, strong) UICollectionView *listCollectionView; |
| 18 | 18 | @property (nonatomic, strong) NSArray *dataSource; |
| 19 | 19 | @end |
| ... | ... | @@ -116,7 +116,15 @@ static NSString *CNServiceOrLookID = @"CNLiveServiceOrLookCell"; |
| 116 | 116 | if ([_model.title isEqual:@"大家都在用"]) { |
| 117 | 117 | return UIEdgeInsetsMake(15, 0, 0, 0); |
| 118 | 118 | } |
| 119 | - return UIEdgeInsetsMake(15, 15, 0, 15); | |
| 119 | + return UIEdgeInsetsMake(15, 0, 0, 0); | |
| 120 | + | |
| 121 | +} | |
| 122 | + | |
| 123 | +- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section{ | |
| 124 | + if ([_model.title isEqual:@"中国服务号"]) { | |
| 125 | + return 5; | |
| 126 | + } | |
| 127 | + return 0; | |
| 120 | 128 | } |
| 121 | 129 | #pragma mark - Setting&&Getting |
| 122 | 130 | -(void)setModel:(CNLiveSearchHotsModel *)model | ... | ... |