1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// PreListView.h
// Gengmei
//
// Created by Sean Lee on 4/7/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GMPreviewCell.h"
#import "GMView.h"
#define PREVIRE_CELL_HEIGHT PREVIRE_CELL_WIDTH
#define PREVIRE_CELL_WIDTH (MAINSCREEN_WIDTH - 30 - PREVIRE_CELL_SPACE * 3)/4 // 每一个unitCell的默认宽度
#define PREVIRE_CELL_SPACE 5 // unitCell之间的间距
#define DURATION 0.5 // 动画执行时间
#define DEFAULT_VISIBLE_COUNT 4 //默认显示的unitCell的个数
@protocol GMPreviewListViewDelegate <NSObject>
@optional
- (void)addPreviewCell;
- (void)retryUploadPreviewCell:(GMPreviewCell *)cell;
- (void)deletePreviewCell:(NSInteger )index;
- (void)fullScreenImage:(GMPreviewCell *)cell;
@end
@interface GMPreviewListView : GMView
@property (nonatomic, strong) NSMutableArray *previewList;
@property (nonatomic,assign)id<GMPreviewListViewDelegate>delegate;
/**
* @brief 添加一个预览图,并返回生成好的cell的位置
*
* @param image cell里装载的图片
*/
- (GMPreviewCell * ) addImage:(UIImage *)image;
/*** @brief 开始上传,显示loading */
- (void)showLoadingAtIndex:(NSInteger)index;
/*** @brief 上传成功,隐藏loading */
- (void)hideLoadingAtIndex:(NSInteger)index;
/*** @brief 重新上传loading */
- (void)retryLoadingAtIndex:(NSInteger)index;
//默认cell 显示的图片
@property (nonatomic, strong) UIImage *defaultCellImage;
//cell的宽高
@property (nonatomic, assign) NSInteger cellWH;
@end