iOS开发必备HUD(透明提示层)

1.MBProgressHUD

GitHub地址:https://github.com/jdg/MBProgressHUD
差不多看到的主流iOS应用都集成了这些,Star
7k了,最近看看众多施用HUD隐藏时,有一个动画过程,我还觉得是自己壮大的,后来研究才意识,有这么些特性animationType:

@property (assign) MBProgressHUDAnimation animationType;

typedef NS_ENUM(NSInteger, MBProgressHUDAnimation) {
    /** Opacity animation */
    MBProgressHUDAnimationFade,
    /** Opacity + scale animation */
    MBProgressHUDAnimationZoom,
    MBProgressHUDAnimationZoomOut = MBProgressHUDAnimationZoom,
    MBProgressHUDAnimationZoomIn
};

Loading效果

还可以够来得1行或2行文字

圆形进度圆

条形进度条

经过自定义图片形成的法力

可以假若文字指示

2. SVProgressHUD

GitHub地址:https://github.com/TransitApp/SVProgressHUD
SVProgressHUD和MBProgressHUD效果差不多,特点就是不需要采纳协议,同时也不需要申明实例。直接通过类格局就可以调用:
[SVProgressHUD method]
[SVProgressHUD dismiss]

效果图.gif

3. JGProgressHUD

GitHub地址:https://github.com/JonasGessner/JGProgressHUD
JGProgressHUD和MBProgressHUD效果差不多,作为后起之秀,特点就是若是有键盘时,HUD可以自行进化,效果非常棒!其它自定义定制也很灵敏。

JGProgressHUD效果图

4. Toast

GitHub地址:https://github.com/scalessec/Toast
本条Toast分外经典。

// basic usage
[self.view makeToast:@"This is a piece of toast."];

// toast with duration, title, and position
[self.view makeToast:@"This is a piece of toast with a title." 
            duration:3.0
            position:CSToastPositionTop
               title:@"Toast Title"];

// toast with an image
[self.view makeToast:@"This is a piece of toast with an image." 
            duration:3.0
            position:[NSValue valueWithCGPoint:CGPointMake(110, 110)]
               image:[UIImage imageNamed:@"toast.png"]];

// display toast with an activity spinner
[self.view makeToastActivity];

Toast部分功能

眼下的话,此前4种HUD就能满足基本需求,实际付出中,集成到一个Utility中就更便利,等自我完善了在放出去分享啦

发表评论

电子邮件地址不会被公开。 必填项已用*标注