Giter Site home page Giter Site logo

xyprogresshud's Introduction

XYProgressHUD

简介

A clean and multithreading progress HUD for your iOS

Demo Overview

如何使用

#import "XYProgressHUD.h"

###只显示一个HUD(单例)

#####提示:单例用于显示单个HUD的场景,如果多个HUD同时显示,会起冲突

  • 显示文字,自动隐藏
[XYProgressHUD showStatus:@""];

  • 显示文字以一定时间,自动隐藏
[XYProgressHUD showStatus:@"" duration:duration];

  • 显示加载动画以一定时间,自动隐藏
[XYProgressHUD showLoadingWithDuration: duration];

  • 显示加载动画和文字以一定时间,自动隐藏
[XYProgressHUD showLoadingWithDuration: duration status:@""];

  • 显示加载动画不限时间,手动隐藏
[XYProgressHUD showLoadingIndefinitely];

  • 显示加载动画和文字不限时间,手动隐藏
[XYProgressHUD showLoadingIndefinitelyWithStatus:@""];

  • 隐藏
[XYProgressHUD dismissLoading];

  • 隐藏以一定时间
[XYProgressHUD dismissLoadingWithDelay:duration];

###只显示一个HUD(非单例)

#####提示:非单例用于依次显示多个HUD的场景,采用FIFO(先进先出)策略

  • 显示文字,自动隐藏
[[XYProgressHUD initHUD] fifo_showStatus:@""];

  • 显示文字以一定时间,自动隐藏
[[XYProgressHUD initHUD] fifo_showStatus:@"" duration:duration];

  • 显示加载动画以一定时间,自动隐藏
[[XYProgressHUD initHUD] fifo_showLoadingWithDuration:duration];

  • 显示加载动画和文字以一定时间,自动隐藏
[[XYProgressHUD initHUD] fifo_showLoadingWithDuration:duration status:@""];

###同时显示多个HUD(非单例)

  • showStatus->showStatus
XYProgressHUD *hud_1 = [XYProgressHUD initHUD];
[hud_1 fifo_showStatus:@"" duration:duration];
                            
XYProgressHUD *hud_2 = [XYProgressHUD initHUD];
[hud_2 fifo_showStatus:@"" duration:duration];

  • showLoading->showStatus
XYProgressHUD *hud_1 = [XYProgressHUD initHUD];
[hud_1 fifo_showLoadingWithDuration:duration];

XYProgressHUD *hud_2 = [XYProgressHUD initHUD];
[hud_2 fifo_showStatus:@"" duration:duration];

  • showLoading->showLoading
XYProgressHUD *hud_1 = [XYProgressHUD initHUD];
[hud_1 fifo_showLoadingWithDuration:duration];

XYProgressHUD *hud_2 = [XYProgressHUD initHUD];
[hud_2 fifo_showLoadingWithDuration:duration];

  • showLoadingStatus->showStatus
XYProgressHUD *hud_1 = [XYProgressHUD initHUD];
[hud_1 fifo_showLoadingWithDuration:duration status:@""];

XYProgressHUD *hud_2 = [XYProgressHUD initHUD];
[hud_2 fifo_showStatus:@"" duration:duration];

##提示 ###如何替换加载动画图片 直接修改Resources文件夹里的图片文件即可

###如何只设置一次属性 后面使用的时候就不用设置 直接用单例实现,比如:

[XYProgressHUD setDefaultStyle:XYProgressHUDStyleCustom];
[XYProgressHUD setFont:[UIFont systemFontOfSize:11]];//字体大小
[XYProgressHUD setForegroundColor:[UIColor blueColor]];//字体颜色,字体颜色必须设置DefaultStyle为XYProgressHUDStyleCustom
[XYProgressHUD showStatus:@"Hello"];

##后期会做

  • XYProgressHUD加一个configuration的属性专门来设置字体颜色,大小等属性
//1.默认配置
XYProgressHUDConfiguration *config = [XYProgressHUDConfiguration defaultConfiguration];

//2.自定义配置
XYProgressHUDConfiguration *config = [XYProgressHUDConfiguration configuration];
[config setDefaultStyle:XYProgressHUDStyleCustom];
[config setFont:[UIFont systemFontOfSize:11]];//字体大小
[config setForegroundColor:[UIColor blueColor]];

[[XYProgressHUD HUDWithConfig:config] fifo_showLoadingWithDuration:duration]

  • 增加overlayview样式

Release Versions

  • v1.0 show with status/loading

xyprogresshud's People

Contributors

fifyrio avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.