BBABlankPageTipView.h
6.06 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
//
// BBABlankPageTipView.h
// BBAPods
//
// Created by liushaohua02 on 31/07/2020.
// Copyright © 2017 Baidu. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, BBABlankPageTipViewThemesMode) {
/// 日间模式
BBABlankPageTipViewThemesModeLight,
/// 暗黑模式
BBABlankPageTipViewThemesModeDark,
/// 自动模式,随应用设置改变,默认使用此选项
BBABlankPageTipViewThemesModeAuto
};
typedef NS_ENUM(NSInteger, BBABlankPageButtonShowType) {
/// 按钮背景颜色为白色 默认为此类型
BBABlankPageButtonShowTypeWhite,
/// 按钮背景颜色为蓝色
BBABlankPageButtonShowTypeBlue
};
typedef void (^BBABlankPageTipViewButtonActionBlock)(void);
@interface BBABlankPageTipView : UIView
/// 主内容视图
@property (nonatomic, strong, readonly) UIView *contentView;
/// 主内容视图中的icon
@property (nonatomic, strong) UIImageView *imageView;
/// 主内容视图中主标题文字
@property (nonatomic, strong) UILabel *label;
/// 主内容视图中的 辅助说明文字
@property (nonatomic, strong) UILabel *descLabel;
/// 重新加载按钮
@property (nonatomic, strong) UIButton *button;
// 重新加载按钮是否可点击, 默认可点击
@property (nonatomic, assign) BOOL enableButtonDefaultAction;
/// 设置网络按钮
@property (nonatomic, strong) UIButton *detectionNetworkButton;
/// 空白提示页面
/// @param frame frame description
/// @param imageName 图片名称 (必传)
/// @param labelText 标题 (必传)
/// @param descText 描述文字
/// @param buttonTitle 按钮文字
/// @param buttonShowType 按钮展示类型,默认是白色背景Style
/// @param buttonClickCallBack 按钮点击回调
- (instancetype)initWithFrame:(CGRect)frame
imageName:(NSString *)imageName
labelText:(NSString *)labelText
descText:(NSString *)descText
buttonTitle:(NSString *)buttonTitle
buttonShowType:(BBABlankPageButtonShowType)buttonShowType
buttonClickCallBack:(BBABlankPageTipViewButtonActionBlock)buttonClickCallBack;
/// 空白提示页面
/// @param frame 空白页面的Frame
/// @param imageName 图片名称 (必传)
/// @param labelText 标题 (必传)
/// @param buttonTitle 按钮文案
/// @param buttonShowType 按钮展示类型,默认是白色背景Style
/// @param buttonClickCallBack 按钮点击回调
/// @param detectionNetworkCallBack 设置网络按钮点击回调,只有设置了此Block回调,才会展示检查网络的超链接按钮,点击会后自动回调 detectionNetworkCallBack
- (instancetype)initWithFrame:(CGRect)frame
imageName:(NSString *)imageName
labelText:(NSString *)labelText
buttonTitle:(NSString *)buttonTitle
buttonShowType:(BBABlankPageButtonShowType)buttonShowType
buttonClickCallBack:(BBABlankPageTipViewButtonActionBlock)buttonClickCallBack
detectionNetworkClickCallBack:(BBABlankPageTipViewButtonActionBlock)detectionNetworkCallBack;
/// 空白提示页面
/// @param frame 空白页面的Frame
/// @param imageName 图片名称 (必传)
/// @param labelText 标题 (必传)
- (instancetype)initWithFrame:(CGRect)frame
imageName:(NSString *)imageName
labelText:(NSString *)labelText;
/// 空白提示页面
/// @param imageName 图片名称(必传)
/// @param labelText 标题 (必传)
- (instancetype)initWithImageName:(NSString *)imageName
labelText:(NSString *)labelText;
/// 重新布局子view
- (void)layoutView;
/// 支持指定主题模式
/// @param themesMode 主题模式
- (void)setThemesMode:(BBABlankPageTipViewThemesMode)themesMode;
- (instancetype)initWithFrame:(CGRect)frame
imageName:(NSString *)imageName
labelText:(NSString *)labelText
descText:(NSString *)descText
buttonTitle:(NSString *)buttonTitle
__attribute__((deprecated("this function has been deprecated please use initWithFrame: imageName: labelText: buttonTitle: buttonClickCallBack: instead")));
- (instancetype)initWithFrame:(CGRect)frame
imageName:(NSString *)imageName
labelText:(NSString *)labelText
buttonTitle:(NSString *)buttonTitle
__attribute__((deprecated("this function has been deprecated please use initWithFrame: imageName: labelText: buttonTitle: buttonClickCallBack: instead")));
- (instancetype)initWithFrame:(CGRect)frame
imageName:(NSString *)imageName
labelText:(NSString *)labelText
buttonTitle:(NSString *)buttonTitle
detectionNetwork:(BOOL)needShow
__attribute__((deprecated("this function has been deprecated please use initWithFrame: imageName: labelText: buttonTitle: buttonClickCallBack: detectionNetworkClickCallBack: instead")));
- (instancetype)initWithImageName:(NSString *)imageName
labelText:(NSString *)labelText
buttonTitle:(NSString *)buttonTitle
__attribute__((deprecated("this function has been deprecated please use initWithFrame: imageName: labelText: buttonTitle: buttonClickCallBack: instead")));
/////////////////////////////////////////////////////////
/**
*下面代码是为了兼容视频SDK,切勿使用,待业务方删除
*/
typedef NS_ENUM(NSInteger, BBABlankPageTipType) {
BBABlankPageTipTypeWiFi
};
typedef enum : NSUInteger {
BBABlankPageTipDefaultWhiteBackground = 0,
BBABlankPageTipBlackBackground = 1,
} BBABlankPageTipBackgroundModel;
typedef void (^BBABlankPageTipViewButtonActionBlock)(void);
- (instancetype)initWithFrame:(CGRect)frame
tipType:(BBABlankPageTipType)tipType
buttonActionBlock:(BBABlankPageTipViewButtonActionBlock)buttonActionBlock
__attribute__((deprecated("this function has been deprecated please use initWithFrame: imageName: labelText: buttonTitle: buttonClickCallBack: instead")));;
-(void)backgroundModel:(BBABlankPageTipBackgroundModel)bgModel;
@end