Update YTPivotBarReorder.m

This commit is contained in:
aricloverEXALT 2025-01-12 15:49:03 -06:00 committed by GitHub
parent e3aa792f6e
commit 1f341a78f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,7 +5,6 @@
#import <YouTubeHeader/YTIPivotBarRenderer.h>
#import <YouTubeHeader/YTIPivotBarSupportedRenderers.h>
#import <YouTubeHeader/YTIPivotBarItemRenderer.h>
#import <YouTubeHeader/YTAssetLoader.h>
@interface YTPivotBarReorder ()
@ -69,12 +68,11 @@
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" forIndexPath:indexPath];
UIImageView *iconView = [[UIImageView alloc] initWithFrame:cell.contentView.bounds];
YTIPivotBarItemRenderer *itemRenderer = self.pivotBarItems[indexPath.row];
iconView.image = [YTAssetLoader loadImageWithIdentifier:itemRenderer.icon.identifier];
iconView.tintColor = [UIColor whiteColor];
iconView.contentMode = UIViewContentModeScaleAspectFit;
[cell.contentView addSubview:iconView];
UILabel *indexLabel = [[UILabel alloc] initWithFrame:cell.contentView.bounds];
indexLabel.text = [NSString stringWithFormat:@"%ld", (long)indexPath.row];
indexLabel.textAlignment = NSTextAlignmentCenter;
indexLabel.textColor = [UIColor whiteColor];
[cell.contentView addSubview:indexLabel];
return cell;
}