MOFirstRechargeRulesView.m 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // MOFirstRechargeRulesView.m
  3. // MiMoLive
  4. //
  5. // Created by SuperC on 2024/9/9.
  6. //
  7. #import "MOFirstRechargeRulesView.h"
  8. @interface MOFirstRechargeRulesView ()
  9. @property (weak, nonatomic) IBOutlet UIView *bgView;
  10. @property (weak, nonatomic) IBOutlet UILabel *titleLab;
  11. @property (weak, nonatomic) IBOutlet UITextView *contentTex;
  12. @end
  13. @implementation MOFirstRechargeRulesView
  14. + (instancetype)moFirstRechargeRulesView{
  15. return [[[NSBundle mainBundle] loadNibNamed:@"MOFirstRechargeRulesView" owner:self options:nil] firstObject];
  16. }
  17. - (void)awakeFromNib{
  18. [super awakeFromNib];
  19. self.bgView.layer.cornerRadius = 16.0;
  20. self.bgView.layer.masksToBounds = YES;
  21. self.titleLab.font = [MOTextTools getTheFontWithSize:20.0 AndFontName:kNormalTitleFontStr];
  22. self.contentTex.font = [MOTextTools getTheFontWithSize:12.0 AndFontName:kNormalContentFontStr];
  23. self.contentTex.text = NSLocalString(@"mimo_first_recharge_rule_content");
  24. self.contentTex.editable = NO;
  25. }
  26. - (IBAction)closeBtnClick:(id)sender {
  27. [self dismissFirstRechargeRulesView];
  28. }
  29. - (void)setRuleContentStr:(NSString *)ruleContentStr{
  30. _ruleContentStr = ruleContentStr;
  31. self.contentTex.text = ruleContentStr;
  32. }
  33. - (void)showFirstRechargeRulesView//界面显示动画
  34. {
  35. UIWindow *keyWindow = [[UIApplication sharedApplication] delegate].window;
  36. [keyWindow addSubview:self];
  37. self.frame = CGRectMake(0.0, 0.0, SCREENWIDTH, SCREENHEIGHT);
  38. //动画效果
  39. self.bgView.transform = CGAffineTransformMakeScale(1.3, 1.3);
  40. self.bgView.alpha = 0;
  41. [UIView animateWithDuration:0.2 animations:^
  42. {
  43. self.bgView.transform = CGAffineTransformMakeScale(1.0, 1.0);
  44. self.bgView.alpha = 1;
  45. } completion:^(BOOL finished)
  46. {
  47. }];
  48. }
  49. - (void)dismissFirstRechargeRulesView
  50. {
  51. [UIView animateWithDuration:0.2 animations:^
  52. {
  53. self.bgView.transform = CGAffineTransformMakeScale(1.3, 1.3);
  54. self.bgView.alpha = 0;
  55. } completion:^(BOOL finished)
  56. {
  57. if (finished)
  58. {
  59. [self removeFromSuperview];
  60. }
  61. }];
  62. }
  63. @end