MJExampleWindow.m 789 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // MJExampleWindow.m
  3. // MJRefreshExample
  4. //
  5. // Created by MJ Lee on 15/8/17.
  6. // Copyright (c) 2015年 小码哥. All rights reserved.
  7. //
  8. #import "MJExampleWindow.h"
  9. #import "MJTempViewController.h"
  10. @implementation MJExampleWindow
  11. static UIWindow *window_;
  12. + (void)show
  13. {
  14. window_ = [[UIWindow alloc] init];
  15. CGFloat width = 150;
  16. CGFloat x = [UIScreen mainScreen].bounds.size.width - width - 10;
  17. CGFloat y = 0;
  18. if ([UIScreen mainScreen].bounds.size.height == 812) {
  19. y = 33;
  20. }
  21. window_.frame = CGRectMake(x, y, width, 25);
  22. window_.windowLevel = UIWindowLevelAlert;
  23. window_.hidden = NO;
  24. window_.alpha = 0.5;
  25. window_.rootViewController = [[MJTempViewController alloc] init];
  26. window_.backgroundColor = [UIColor clearColor];
  27. }
  28. @end