GXCardView
卡片式布局(探探附近/QQ配对),用法与 tableView 相同,根据网友反馈已添加重复循环属性,最新版本还添加了平滑加载更多数据功能。有建议可联系 QQ:279694479。
喜欢就给个star哦,QQ:279694479
先展示demo菜单效果(比较简单,请勿介意)
需求
- iOS 7.0 或更高版本
- Xcode 9.0 或更高版本
在您的Podfile中的使用
pod 'GXCardView'
GXCardViewDataSource
- (NSInteger)numberOfCountInCardView:(GXCardView *)cardView;
- (GXCardViewCell *)cardView:(GXCardView *)cardView cellForRowAtIndex:(NSInteger)index;
GXCardViewDelegate
- (void)cardView:(GXCardView *)cardView didRemoveCell:(GXCardViewCell *)cell forRowAtIndex:(NSInteger)index direction:(GXCardCellSwipeDirection)direction;
- (void)cardView:(GXCardView *)cardView didRemoveLastCell:(GXCardViewCell *)cell forRowAtIndex:(NSInteger)index;
- (void)cardView:(GXCardView *)cardView didDisplayCell:(GXCardViewCell *)cell forRowAtIndex:(NSInteger)index;
- (void)cardView:(GXCardView *)cardView didMoveCell:(GXCardViewCell *)cell forMovePoint:(CGPoint)point direction:(GXCardCellSwipeDirection)direction;
重载数据
- (void)reloadData;
- (void)reloadDataAnimated:(BOOL)animated;
加载更多数据
- (void)reloadMoreData;
- (void)reloadMoreDataAnimated:(BOOL)animated;
从index开始加载
- (void)reloadDataFormIndex:(NSInteger)index;
- (void)reloadDataFormIndex:(NSInteger)index animated:(BOOL)animated;
可设置参数
/** 卡片可见数量(默认3) */
@property (nonatomic, assign) NSInteger visibleCount;
/** 行间距(默认10.0,可自行计算scale比例来做间距) */
@property (nonatomic, assign) CGFloat lineSpacing;
/** 列间距(默认10.0,可自行计算scale比例来做间距) */
@property (nonatomic, assign) CGFloat interitemSpacing;
/** 侧滑最大角度(默认15°) */
@property (nonatomic, assign) CGFloat maxAngle;
/** 最大移除距离(默认屏幕的1/4) */
@property (nonatomic, assign) CGFloat maxRemoveDistance;
/** 是否重复(默认NO) */
@property (nonatomic, assign) BOOL isRepeat;
许可
MIT