博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SSProgressHUD - 加载动画提示、文字和图片提示、进度加载提示、可自定义、方便的API调用...
阅读量:6914 次
发布时间:2019-06-27

本文共 2923 字,大约阅读时间需要 9 分钟。

SSProgressHUD

  • 加载动画提示、文字和图片提示、进度加载提示、可自定义
  • ,觉得OK的记得给个star哦?

预览动画

功能说明

  • loading动画加文字自适应
  • 文字提示,支持视图消失时回调
  • 图片加文字提示自适应,支持视图消失时回调
  • 进度加载,支持全部加载时回调
  • 可自定义customView
  • 多种属性设置,例如:颜色风格、遮罩类型、中心点偏移
  • 提供分类API调用
  • 可以同时显示多个hud,通过tag标记显示移除

具体使用

例如Loading加文字

SSProgressHUD *hud = [[SSProgressHUD alloc]initWithMode:SSProgressHUDModeLoadingAndText];hud.customText = text;[hud showOnView:self.view animated:YES];复制代码

通过中点偏移量自定义hud的位置

hud.viewCenterOffet = CGPointMake(0,-20);复制代码

设置自定义视图的内间距

hud.customViewEdgeInsets = UIEdgeInsetsMake(20,20,20,20);复制代码

自定义视图

UIView *customView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 90, 200)];SSProgressHUD *hud = [[SSProgressHUD alloc]initWithCustomView:customView]复制代码

快捷调用API

@interface NSObject (SSProgressHUD)/* *tag参数的说明: 1、当tag等于-1或者大于0的时候,每个tag对应一个hud。 2、如果展示的是文字提示的tag为0,不会缓存hud。 3、loading的时候默认tag为-1;  *////loading,没文字- (void)showLoading;- (void)showLoadingWithMaskType:(SSProgressHUDMaskType)maskType;- (void)showLoadingWithTag:(NSInteger)tag;- (void)showLoadingWithTag:(NSInteger)tag maskType:(SSProgressHUDMaskType)maskType;///loading,有文字- (void)showLoadingText:(NSString * _Nullable )text;- (void)showLoadingText:(NSString * _Nullable )text maskType:(SSProgressHUDMaskType)maskType;- (void)showLoadingText:(NSString * _Nullable )text tag:(NSInteger)tag;- (void)showLoadingText:(NSString * _Nullable )text tag:(NSInteger)tag maskType:(SSProgressHUDMaskType)maskType;///文字提示- (void)showText:(NSString *)text;///文字提示,有消失时回调- (void)showText:(NSString *)text finished:(void(^ __nullable)(void))finished;- (void)showText:(NSString *)text maskType:(SSProgressHUDMaskType)maskType finished:(void(^ __nullable)(void))finished;///进度条- (void)showProgress:(CGFloat)progress finished:(void(^ __nullable)(void))finished;- (void)showProgress:(CGFloat)progress maskType:(SSProgressHUDMaskType)maskType finished:(void(^ __nullable)(void))finished;- (void)showProgress:(CGFloat)progress text:(NSString * _Nullable)text finished:(void(^ __nullable)(void))finished;- (void)showProgress:(CGFloat)progress text:(NSString * _Nullable)text maskType:(SSProgressHUDMaskType)maskType finished:(void(^ __nullable)(void))finished;///图片- (void)showHUDWithImageName:(NSString *)imageName;- (void)showHUDWithImageName:(NSString *)imageName text:(NSString * _Nullable)text;- (void)showHUDWithImageName:(NSString *)imageName text:(NSString * _Nullable)text finished:(void(^__nullable)(void))finished;- (void)showHUDWithImageName:(NSString *)imageName text:(NSString * _Nullable)text maskType:(SSProgressHUDMaskType)maskType finished:(void(^__nullable)(void))finished;///隐藏- (void)hideHUD;- (void)hideHUDWithTag:(NSInteger)tag;- (void)hideHUDAnimated:(BOOL)animated;- (void)hideHUDAnimated:(BOOL)animated tag:(NSInteger)tag;- (void)hideHUDAnimated:(BOOL)animated finished:(void(^ __nullable)(void))finished;- (void)hideHUDAnimated:(BOOL)animated tag:(NSInteger)tag finished:(void(^ __nullable)(void))finished;@end复制代码

其他功能具体请看Demo的用法

转载地址:http://usacl.baihongyu.com/

你可能感兴趣的文章
基于linux 的mysql的主从同步配置读写分离
查看>>
javadoc的用法
查看>>
大地 Ghost Win7Sp1x86 装机版Y9.8
查看>>
Date的简单介绍
查看>>
Windows/Mac跑起XDAG源码
查看>>
C语言字符串操作函数
查看>>
富文本编辑器summernote使用
查看>>
马哥2016全新Linux+Python高端运维班第三周作业
查看>>
linux后台进程启动springboot
查看>>
Seo界神话 360好搜
查看>>
JavaScript闭包
查看>>
datatables服务器端分页
查看>>
用PL/SQL Developer导出表数据的时候,窗口一闪而过解决办法
查看>>
杨辉三角
查看>>
将 Log4j 配置文件放在项目外面
查看>>
nginx日志切割
查看>>
以太坊Dapp终极教程——如何构建一个完整的全栈去中心化应用(二)
查看>>
客户端bug测试贴
查看>>
java web 开发 编码问题详解
查看>>
python写的发邮件的小程序!
查看>>