|
@@ -47,6 +47,7 @@
|
|
|
|
|
|
self.titleLabel = [[UILabel alloc] init];
|
|
|
self.titleLabel.text = title;
|
|
|
+ self.titleLabel.textAlignment = NSTextAlignmentCenter;
|
|
|
[self.headerView addSubview:self.titleLabel];
|
|
|
|
|
|
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
|
@@ -70,7 +71,7 @@
|
|
|
- (void)layoutSubviews {
|
|
|
[super layoutSubviews];
|
|
|
self.backBtn.frame = CGRectMake(15, 5, 60, 50);
|
|
|
- self.titleLabel.frame = CGRectMake((self.frame.size.width - 100)/2, 5, 100, 50);
|
|
|
+ self.titleLabel.frame = CGRectMake((self.frame.size.width - 150)/2, 5, 150, 50);
|
|
|
self.headerView.frame = CGRectMake(0, 0, self.bounds.size.width, 50);
|
|
|
}
|
|
|
|
|
@@ -95,6 +96,9 @@
|
|
|
|
|
|
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
CPDFArrowStyleCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
|
|
|
+ if (self.selectIndex == indexPath.item) {
|
|
|
+ cell.contextView.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
|
|
|
+ }
|
|
|
cell.contextView.selectIndex = indexPath.item;
|
|
|
[cell.contentView setNeedsDisplay];
|
|
|
cell.backgroundColor = [UIColor clearColor];
|
|
@@ -106,7 +110,7 @@
|
|
|
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
NSArray<UICollectionViewCell *> *cells = [collectionView visibleCells];
|
|
|
for (UICollectionViewCell *cell in cells) {
|
|
|
- ((CPDFArrowStyleCell *)cell).contextView.backgroundColor = [UIColor whiteColor];
|
|
|
+ ((CPDFArrowStyleCell *)cell).contextView.backgroundColor = [CPDFColorUtils CAnnotationBarNoSelectBackgroundColor];
|
|
|
}
|
|
|
CPDFArrowStyleCell *cell = (CPDFArrowStyleCell *)[collectionView cellForItemAtIndexPath:indexPath];
|
|
|
cell.contextView.backgroundColor = [CPDFColorUtils CAnnotationBarSelectBackgroundColor];
|