TipsQRCodeForChangeDeviceViewController.m 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. //
  2. // TipsQRCodeForChangeDeviceViewController.m
  3. // 隐私保护
  4. //
  5. // Created by APPLE on 2023/9/19.
  6. //
  7. #import "TipsQRCodeForChangeDeviceViewController.h"
  8. #import <Masonry.h>
  9. #import "UIView+View.h"
  10. #import "QRCodeScanForChangeDeviceViewController.h"
  11. @interface TipsQRCodeForChangeDeviceViewController ()
  12. @end
  13. @implementation TipsQRCodeForChangeDeviceViewController
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. // Do any additional setup after loading the view.
  17. [self drawAnyView];
  18. [self.view bringSubviewToFront:self.navBarBGView];
  19. [self.navBarBGView setBackgroundColor:[UIColor clearColor]];
  20. }
  21. - (void)drawAnyView{
  22. [self.navigationBar setHidden:YES];
  23. [self.toolBar setHidden:YES];
  24. [self.navBarBGView setHidden:NO];
  25. [self.titleLabel setText:NSLocalizedString(@"my_set_no_change_phone",nil)];
  26. /*背景视图*/
  27. UIImageView *bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"guide_qrcode_bg_icon"]];
  28. [bgImageView setContentMode:(UIViewContentModeScaleToFill)];
  29. [self.view addSubview:bgImageView];
  30. [bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  31. make.top.mas_equalTo(0);
  32. make.bottom.mas_equalTo(0);
  33. make.left.mas_equalTo(0);
  34. make.right.mas_equalTo(0);
  35. }];
  36. UIButton *qrcodeBtn = [[UIButton alloc] init];
  37. [qrcodeBtn setBackgroundColor:[UIColor clearColor]];
  38. [qrcodeBtn setBackgroundImage:[UIImage imageNamed:@"guide_qrcode_icon"] forState:(UIControlStateNormal)];
  39. [self.view addSubview:qrcodeBtn];
  40. [qrcodeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  41. make.top.mas_equalTo((363.f/812.f)*self.view.height - 80.f);
  42. make.centerX.equalTo(self.view.mas_centerX);
  43. make.width.mas_equalTo(160);
  44. make.height.mas_equalTo(160);
  45. }];
  46. [qrcodeBtn addTarget:self
  47. action:@selector(qrcodeBtnPressed)
  48. forControlEvents:(UIControlEventTouchUpInside)];
  49. /*提示文字*/
  50. UILabel *tipsLabel = [[UILabel alloc] init];
  51. [tipsLabel setFont:[UIFont systemFontOfSize:14]];
  52. [tipsLabel setTextColor:HW666666Color];
  53. [tipsLabel setTextAlignment:(NSTextAlignmentCenter)];
  54. [self.view addSubview:tipsLabel];
  55. [tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  56. make.top.equalTo(qrcodeBtn.mas_bottom).offset(8);
  57. make.left.mas_equalTo(60);
  58. make.right.mas_equalTo(-60);
  59. }];
  60. [tipsLabel setText:NSLocalizedString(@"guide_qrcoede_tips",nil)];
  61. /*扫一扫按钮*/
  62. UIButton *qrcodeSmallBtn = [[UIButton alloc] init];
  63. qrcodeSmallBtn.frame = CGRectMake(0, 0, 120.f, 36.f);
  64. // gradient
  65. CAGradientLayer *gl = [CAGradientLayer layer];
  66. gl.frame = CGRectMake(0,0,120.f,36.f);
  67. gl.startPoint = CGPointMake(0, 0.5);
  68. gl.endPoint = CGPointMake(1, 0.5);
  69. gl.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
  70. gl.locations = @[@(0), @(1.0f)];
  71. [qrcodeSmallBtn.layer addSublayer:gl];
  72. [qrcodeSmallBtn addTarget:self action:@selector(qrcodeBtnPressed) forControlEvents:(UIControlEventTouchUpInside)];
  73. [qrcodeSmallBtn setTitle:NSLocalizedString(@"guide_qrcoede_btn_title",nil) forState:(UIControlStateNormal)];
  74. [qrcodeSmallBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
  75. [qrcodeSmallBtn.titleLabel setFont:[UIFont systemFontOfSize:14.f]];
  76. [qrcodeSmallBtn.layer setCornerRadius:18.f];
  77. qrcodeSmallBtn.clipsToBounds = YES;
  78. [self.view addSubview:qrcodeSmallBtn];
  79. [qrcodeSmallBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  80. make.centerX.equalTo(self.view.mas_centerX);
  81. make.width.mas_equalTo(120.f);
  82. make.top.equalTo(tipsLabel.mas_bottom).offset(20);
  83. make.height.mas_equalTo(36.f);
  84. }];
  85. }
  86. - (void)qrcodeBtnPressed{
  87. QRCodeScanForChangeDeviceViewController *nextVC = [[QRCodeScanForChangeDeviceViewController alloc] init];
  88. [self.navigationController pushViewController:nextVC animated:YES];
  89. }
  90. /*
  91. #pragma mark - Navigation
  92. // In a storyboard-based application, you will often want to do a little preparation before navigation
  93. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  94. // Get the new view controller using [segue destinationViewController].
  95. // Pass the selected object to the new view controller.
  96. }
  97. */
  98. @end