Skip to content

Commit c001539

Browse files
author
MrChen
authored
Update EasyLoding_README.md
1 parent ad960cd commit c001539

File tree

1 file changed

+57
-42
lines changed

1 file changed

+57
-42
lines changed

README/EasyLoding_README.md

Lines changed: 57 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,106 @@
11
## EasyText使用方法
22

3+
<br>
4+
35
#### 在AppDelegate中设置全局的配置信息 -- (可省略)
46

57
```
68
#import "EasyTextGlobalConfig.h"
79
810
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
911
{
10-
/**显示文字**/
11-
EasyTextGlobalConfig *config = [EasyTextGlobalConfig shared];
12-
config.bgColor = [UIColor whiteColor];
13-
config.titleColor = [UIColor blackColor];
12+
/**显示加载框**/
13+
EasyLodingGlobalConfig *lodingConfig = [EasyLodingGlobalConfig shared];
14+
lodingConfig.lodingType = LodingAnimationTypeFade ;
15+
NSMutableArray *tempArr = [NSMutableArray arrayWithCapacity:8];
16+
for (int i = 0; i < 9; i++) {
17+
UIImage *img = [UIImage imageNamed:[NSString stringWithFormat:@"icon_hud_%d",i+1]];
18+
[tempArr addObject:img] ;
19+
}
20+
lodingConfig.playImagesArray = tempArr ;
1421
}
1522
```
1623

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

1928
```
2029
/**
21-
* 显示一个纯文字消息 (config:显示属性设置)
30+
* 显示一个加载框(config:显示属性设置)
2231
*/
23-
+ (void)showText:(NSString *)text ;
24-
+ (void)showText:(NSString *)text config:(EasyTextConfig *(^)(void))config ;
25-
```
26-
32+
+ (EasyLodingView *)showLoding ;
33+
+ (EasyLodingView *)showLodingText:(NSString *)text ;
34+
+ (EasyLodingView *)showLodingText:(NSString *)text
35+
config:(EasyLodingConfig *(^)(void))config ;
2736
2837
```
29-
/**
30-
* 显示一个成功消息(config:显示属性设置)
31-
*/
32-
+ (void)showSuccessText:(NSString *)text ;
33-
+ (void)showSuccessText:(NSString *)text config:(EasyTextConfig *(^)(void))config ;
3438

35-
```
3639

3740
```
3841
/**
39-
* 显示一个错误消息(config:显示属性设置)
42+
* 显示一个带图片的加载框 (config:显示属性设置)
4043
*/
41-
+ (void)showErrorText:(NSString *)text ;
42-
+ (void)showErrorText:(NSString *)text config:(EasyTextConfig *(^)(void))config ;
44+
+ (EasyLodingView *)showLodingText:(NSString *)text
45+
imageName:(NSString *)imageName ;
46+
+ (EasyLodingView *)showLodingText:(NSString *)text
47+
imageName:(NSString *)imageName
48+
config:(EasyLodingConfig *(^)(void))config ;
4349
4450
```
4551

4652
```
4753
/**
48-
* 显示一个提示消息(config:显示属性设置)
54+
* 移除一个加载框
55+
* superview:加载框所在的父视图。(如果show没指定父视图。那么隐藏也不用)
4956
*/
50-
+ (void)showInfoText:(NSString *)text ;
51-
+ (void)showInfoText:(NSString *)text config:(EasyTextConfig *(^)(void))config ;
57+
+ (void)hidenLoding ;
58+
+ (void)hidenLoingInView:(UIView *)superView ;
59+
+ (void)hidenLoding:(EasyLodingView *)lodingView ;
5260
53-
```
5461
5562
```
56-
/**
57-
* 显示一个自定义图片消息(config:显示属性设置)
58-
*/
59-
+ (void)showImageText:(NSString *)text imageName:(NSString *)imageName ;
60-
+ (void)showImageText:(NSString *)text imageName:(NSString *)imageName config:(EasyTextConfig *(^)(void))config ;
6163

62-
```
64+
<br>
6365

6466
#### 举例说明
67+
68+
__显示lodingview__
6569
```
6670
//没有加配置信息,所以显示的样式都会使用appdelegate中EasyTextGlobalConfig设置的。
67-
[EasyTextView showSuccessText:@"显示成功消息!"];
71+
[EasyLodingView showLodingText:@"加载中..."];
6872
6973
//增加config配置信息。那么statusType属性会使用刚设置的。其他属性会继续使用EasyTextGlobalConfig设置的。
70-
[EasyTextView showErrorText:@"服务器错误!" config:^EasyTextConfig *{
71-
return [EasyTextConfig shared].setStatusType(TextStatusTypeNavigation) ;
72-
}];
74+
[EasyLodingView showLodingText:@"正在努力加载中..." config:^EasyLodingConfig *{
75+
return [EasyLodingConfig shared].setLodingType(LodingShowTypeIndicatorLeft);
76+
}];
7377
7478
```
75-
#### EasyTextConfig说明:它是显示属性的配置信息。提供了三种方法。这三种方法都是一样的,根据使用习惯选择一种就行。
79+
__隐藏lodingview__
80+
```
81+
//会移除window或者是topviewcontroller上所有的lidngview
82+
[EasyLodingView hidenLoding];
83+
84+
//移除特定的lodingview
85+
[EasyLodingView hidenLoding:lodingV];
86+
7687
```
88+
<br>
89+
90+
#### EasyLodingConfig:它是显示属性的配置信息。提供了三种方法。这三种方法都是一样的,根据使用习惯选择一种就行。
91+
```
92+
7793
//方法一
78-
return [EasyTextConfig configWithSuperView:self.view superReceiveEvent:ShowTextEventUndefine animationType:TextAnimationTypeNone textStatusType:TextStatusTypeBottom];
94+
return [EasyLodingConfig configInView:self.view showType:LodingShowTypePlayImagesLeft];
95+
7996
//方法二
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 ;
97+
return [EasyLodingConfig shared].setLodingType(LodingShowTypePlayImagesLeft).setSuperReceiveEvent(NO);
98+
99+
//方法三
100+
EasyLodingConfig *config = [EasyLodingConfig shared];
101+
config.lodingType = LodingShowTypePlayImagesLeft ;
102+
config.superView = self.view ;
87103
return config ;
88104
```
89105

90106

91-

0 commit comments

Comments
 (0)