Skip to content

Commit 7594d78

Browse files
author
MrChen
authored
Update EasyEmpty_README.md
1 parent c001539 commit 7594d78

File tree

1 file changed

+63
-59
lines changed

1 file changed

+63
-59
lines changed

README/EasyEmpty_README.md

Lines changed: 63 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,95 @@
1-
## EasyText使用方法
1+
## EasyEmptyView使用方法
2+
3+
<br>
4+
25

36
#### 在AppDelegate中设置全局的配置信息 -- (可省略)
47

58
```
6-
#import "EasyTextGlobalConfig.h"
9+
#import "EasyEmptyGlobalConfig.h"
710
811
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
912
{
10-
/**显示文字**/
11-
EasyTextGlobalConfig *config = [EasyTextGlobalConfig shared];
12-
config.bgColor = [UIColor whiteColor];
13-
config.titleColor = [UIColor blackColor];
13+
/**显示空白页面**/
14+
EasyEmptyGlobalConfig *emptyConfig = [EasyEmptyGlobalConfig shared];
15+
emptyConfig.bgColor = [UIColor groupTableViewBackgroundColor];
16+
17+
return YES;
1418
}
1519
```
1620

21+
<br>
22+
23+
1724
#### 调用显示方法 --(如果单独某个显示视图不想用全局的配置信息,可以在每个显示方法中的config配置)
1825

1926
```
20-
/**
21-
* 显示一个纯文字消息 (config:显示属性设置)
22-
*/
23-
+ (void)showText:(NSString *)text ;
24-
+ (void)showText:(NSString *)text config:(EasyTextConfig *(^)(void))config ;
27+
+ (EasyEmptyView *)showEmptyInView:(UIView *)superview
28+
item:(EasyEmptyPart *(^)(void))item ;
29+
30+
+ (EasyEmptyView *)showEmptyInView:(UIView *)superview
31+
item:(EasyEmptyPart *(^)(void))item
32+
config:(EasyEmptyConfig *(^)(void))config ;
33+
34+
+ (EasyEmptyView *)showEmptyInView:(UIView *)superview
35+
item:(EasyEmptyPart *(^)(void))item
36+
config:(EasyEmptyConfig *(^)(void))config
37+
callback:(emptyViewCallback)callback ;
38+
2539
```
2640

27-
2841
```
29-
/**
30-
* 显示一个成功消息(config:显示属性设置)
31-
*/
32-
+ (void)showSuccessText:(NSString *)text ;
33-
+ (void)showSuccessText:(NSString *)text config:(EasyTextConfig *(^)(void))config ;
34-
42+
+ (void)hiddenEmptyInView:(UIView *)superView ;
43+
+ (void)hiddenEmptyView:(EasyEmptyView *)emptyView ;
3544
```
3645

37-
```
38-
/**
39-
* 显示一个错误消息(config:显示属性设置)
40-
*/
41-
+ (void)showErrorText:(NSString *)text ;
42-
+ (void)showErrorText:(NSString *)text config:(EasyTextConfig *(^)(void))config ;
4346

44-
```
47+
<br>
4548

46-
```
47-
/**
48-
* 显示一个提示消息(config:显示属性设置)
49-
*/
50-
+ (void)showInfoText:(NSString *)text ;
51-
+ (void)showInfoText:(NSString *)text config:(EasyTextConfig *(^)(void))config ;
5249

50+
#### 举例说明
5351
```
54-
52+
[EasyEmptyView showEmptyInView:self.view item:^EasyEmptyPart *{
53+
return [EasyEmptyPart shared].setTitle(@"网络连接已断开").setImageName(@"netError.png") ;
54+
} config:^EasyEmptyConfig *{
55+
return [EasyEmptyConfig shared].setTitleColor([UIColor redColor]).setScrollVerticalEnable(NO);
56+
} callback:^(EasyEmptyView *view, UIButton *button, callbackType callbackType) {
57+
[EasyEmptyView hiddenEmptyInView:self.view];
58+
}];
5559
```
56-
/**
57-
* 显示一个自定义图片消息(config:显示属性设置)
58-
*/
59-
+ (void)showImageText:(NSString *)text imageName:(NSString *)imageName ;
60-
+ (void)showImageText:(NSString *)text imageName:(NSString *)imageName config:(EasyTextConfig *(^)(void))config ;
6160

62-
```
61+
<br>
6362

64-
#### 举例说明
65-
```
66-
//没有加配置信息,所以显示的样式都会使用appdelegate中EasyTextGlobalConfig设置的。
67-
[EasyTextView showSuccessText:@"显示成功消息!"];
68-
69-
//增加config配置信息。那么statusType属性会使用刚设置的。其他属性会继续使用EasyTextGlobalConfig设置的。
70-
[EasyTextView showErrorText:@"服务器错误!" config:^EasyTextConfig *{
71-
return [EasyTextConfig shared].setStatusType(TextStatusTypeNavigation) ;
72-
}];
7363

64+
#### EasyEmptyPart:empty所需要系那是的字视图,根据自己都需要选择
7465
```
75-
#### EasyTextConfig说明:它是显示属性的配置信息。提供了三种方法。这三种方法都是一样的,根据使用习惯选择一种就行。
66+
@property (nonatomic,strong)NSString *title ; //标题
67+
@property (nonatomic,strong)NSString *subtitle ; //副标题
68+
@property (nonatomic,strong)NSString *imageName ; //图片名称
69+
@property (nonatomic,strong)NSArray<NSString *> *buttonArray ;//下面需要的按钮
7670
```
77-
//方法一
78-
return [EasyTextConfig configWithSuperView:self.view superReceiveEvent:ShowTextEventUndefine animationType:TextAnimationTypeNone textStatusType:TextStatusTypeBottom];
79-
//方法二
80-
return [EasyTextConfig shared].setBgColor([UIColor lightGrayColor]).setShadowColor([UIColor clearColor]).setStatusType(TextStatusTypeBottom);
81-
//方法三
82-
EasyTextConfig *config = [EasyTextConfig shared];
83-
config.bgColor = [UIColor lightGrayColor] ;
84-
config.shadowColor = [UIColor clearColor] ;
85-
config.animationType = TextAnimationTypeFade;
86-
config.statusType = TextStatusTypeBottom ;
87-
return config ;
71+
72+
<br>
73+
74+
75+
#### EasyEmptyConfig:它是显示属性的配置信息。提供了三种方法。这三种方法都是一样的,根据使用习惯选择一种就行。
76+
8877
```
78+
@property (nonatomic,strong)UIColor *bgColor ; //背景颜色
79+
80+
@property (nonatomic,strong)UIFont *tittleFont ; //标题字体大小
81+
@property (nonatomic,strong)UIColor *titleColor ;//标题字体颜色
82+
83+
@property (nonatomic,strong)UIFont *subtitleFont ; //副标题字体大小
84+
@property (nonatomic,strong)UIColor *subTitleColor ;//副标题字体颜色
8985
86+
@property (nonatomic,strong)UIFont *buttonFont ; //按钮字体大小
87+
@property (nonatomic,strong)UIColor *buttonColor ; //按钮字体亚瑟
88+
@property (nonatomic,strong)UIColor *buttonBgColor ;//按钮背景颜色
89+
90+
@property (nonatomic,assign)UIEdgeInsets easyViewEdgeInsets ;//整个emptyview往内缩的距离(如果为负数,则会超出边界)
91+
@property (nonatomic,assign)UIEdgeInsets buttonEdgeInsets ; //按钮往内缩的边距(按钮四边边缘距离文字的距离)
92+
@property (nonatomic,assign)BOOL scrollVerticalEnable ;//是否可以上下滚动
93+
```
9094

9195

0 commit comments

Comments
 (0)