// // cloudPhoneSetView.m // Private-X // // Created by xd h on 2024/6/24. // #import "cloudPhoneSetView.h" @implementation cloudPhoneSetView - (id)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; self.backgroundColor = [UIColor hwColor:@"#000000" alpha:0.6]; [self drawAnyView]; return self; } -(void)drawAnyView { //大按钮响应 UIButton *bigRightButton = [[UIButton alloc] init]; bigRightButton.tag = 1; [bigRightButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside]; [self addSubview:bigRightButton]; //bigRightButton.backgroundColor= [UIColor redColor]; [bigRightButton mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(0); make.left.mas_equalTo(0); make.right.mas_equalTo(0); make.bottom.mas_equalTo(0); }]; UIView *whiteBgView = [[UIView alloc] init]; whiteBgView.backgroundColor = [UIColor whiteColor]; [self addSubview:whiteBgView]; whiteBgView.layer.cornerRadius = 8; whiteBgView.layer.masksToBounds = YES; CGFloat curWhiteWidth = 132.0; NSArray *arLanguages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"]; NSLog(@"arLanguages:%@",arLanguages); ///获取设备当前地区的代码和APP语言环境 NSString *languageCode = [NSLocale preferredLanguages][0]; //目前支持 中文(简体 繁体) 英文 日语 if([languageCode rangeOfString:@"zh-Hans"].location != NSNotFound) { } else if([languageCode rangeOfString:@"zh-Hant"].location != NSNotFound) { } else{ curWhiteWidth = 172; } [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(100); make.right.mas_equalTo(-12); make.width.mas_equalTo(curWhiteWidth); //make.width.mas_equalTo(132); make.height.mas_equalTo(100); //make.height.mas_equalTo(150); }]; NSArray *butImageArr = @[//@"cloudPhone_uploadApp", @"cloudPhone_reStart",@"cloudPhone_reset"]; NSArray *butTextArr = @[//NSLocalizedString(@"cloudPhone_upload_app",nil), NSLocalizedString(@"my_set_no_restart_phone",nil), NSLocalizedString(@"my_set_no_Restore_Factory",nil)]; CGFloat butHeight = 50.0; for (int i=0; i