説明なし

FLProgressHUDHelper.m 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // MBProgressHUDHelper.m
  3. // FirstLink
  4. //
  5. // Created by unicode on 14-10-20.
  6. // Copyright (c) 2014年 FirstLink. All rights reserved.
  7. //
  8. #import "FLProgressHUDHelper.h"
  9. @implementation FLProgressHUDHelper
  10. + (void)showText:(NSString *)text inView:(UIView *)view
  11. {
  12. if (!text || text.length == 0 || !view) {
  13. return;
  14. }
  15. MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
  16. // Configure for text only and offset down
  17. hud.mode = MBProgressHUDModeText;
  18. hud.detailsLabelText = text;
  19. hud.detailsLabelFont = [UIFont systemFontOfSize:16];
  20. hud.margin = 10.f;
  21. hud.removeFromSuperViewOnHide = YES;
  22. hud.animationType = MBProgressHUDAnimationZoomOut;
  23. hud.userInteractionEnabled = NO;
  24. [hud show:YES];
  25. [hud hide:YES afterDelay:2];
  26. }
  27. + (void)showTipAlert:(NSString *)text {
  28. UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@""
  29. message:text
  30. delegate:nil
  31. cancelButtonTitle:@"确定"
  32. otherButtonTitles:nil, nil];
  33. [alert show];
  34. }
  35. + (void)showCustomView:(UIView *)customView inView:(UIView *)view withComplitionBlock:(void(^)(void))complition{
  36. if (!customView || !view) return;
  37. MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
  38. hud.mode = MBProgressHUDModeCustomView;
  39. hud.customView = customView;
  40. hud.completionBlock = complition;
  41. [hud show:YES];
  42. [hud hide:NO afterDelay:2];
  43. }
  44. @end