59 lines
2.1 KiB
Mathematica
59 lines
2.1 KiB
Mathematica
|
|
//
|
|||
|
|
// KBPaySvipVC.m
|
|||
|
|
// keyBoard
|
|||
|
|
//
|
|||
|
|
// Created by Mac on 2026/2/3.
|
|||
|
|
//
|
|||
|
|
|
|||
|
|
#import "KBPaySvipVC.h"
|
|||
|
|
|
|||
|
|
@interface KBPaySvipVC ()<UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
|
|||
|
|
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
|
|||
|
|
@property (nonatomic, strong) UICollectionView *collectionView;
|
|||
|
|
@end
|
|||
|
|
|
|||
|
|
@implementation KBPaySvipVC
|
|||
|
|
|
|||
|
|
- (void)viewDidLoad {
|
|||
|
|
[super viewDidLoad];
|
|||
|
|
// Do any additional setup after loading the view.
|
|||
|
|
// 懒加载 collectionView,并添加到视图
|
|||
|
|
[self.view addSubview:self.collectionView];
|
|||
|
|
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|||
|
|
make.edges.equalTo(self.view); // mas 布局:铺满
|
|||
|
|
}];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#pragma mark - UIScrollView Delegate(转发给分页容器)
|
|||
|
|
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
|||
|
|
!self.scrollCallback ?: self.scrollCallback(scrollView);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#pragma mark - JXPagingViewListViewDelegate
|
|||
|
|
- (UIView *)listView { return self.view; }
|
|||
|
|
- (UIScrollView *)listScrollView { return self.collectionView; }
|
|||
|
|
- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback { self.scrollCallback = callback; }
|
|||
|
|
- (void)listWillAppear { NSLog(@"%@:%@", self.title, NSStringFromSelector(_cmd)); }
|
|||
|
|
- (void)listDidAppear { NSLog(@"%@:%@", self.title, NSStringFromSelector(_cmd)); }
|
|||
|
|
- (void)listWillDisappear { NSLog(@"%@:%@", self.title, NSStringFromSelector(_cmd)); }
|
|||
|
|
- (void)listDidDisappear { NSLog(@"%@:%@", self.title, NSStringFromSelector(_cmd)); }
|
|||
|
|
|
|||
|
|
|
|||
|
|
#pragma mark - Lazy
|
|||
|
|
- (UICollectionView *)collectionView {
|
|||
|
|
if (!_collectionView) {
|
|||
|
|
UICollectionViewFlowLayout *layout = [UICollectionViewFlowLayout new];
|
|||
|
|
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
|
|||
|
|
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
|||
|
|
_collectionView.backgroundColor = [UIColor clearColor];
|
|||
|
|
// _collectionView.dataSource = self;
|
|||
|
|
// _collectionView.delegate = self;
|
|||
|
|
// 注册皮肤卡片 cell
|
|||
|
|
// [_collectionView registerClass:KBSkinCardCell.class forCellWithReuseIdentifier:@"KBSkinCardCell"]; // 复用标识
|
|||
|
|
}
|
|||
|
|
return _collectionView;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
@end
|