1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- //
- // YOUPAIFateWindow.m
- // MSYOUPAI
- //
- // Created by xiaohaoran on 2022/3/30.
- // Copyright © 2022 MS. All rights reserved.
- //
- #import "YOUPAIFateWindow.h"
- @interface YOUPAIFateWindow ()
- @end
- @implementation YOUPAIFateWindow
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self setupUI];
-
-
- }
- -(void)setupUI{
- //bgView
- UIView *bgView = [UIView new];
- [self.view addSubview:bgView];
- [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.mas_equalTo(0);
- make.left.mas_equalTo(31);
- make.right.mas_equalTo(-31);
- make.height.mas_equalTo(417+37);
- }];
- bgView.backgroundColor = [UIColor clearColor];
-
- UIView *bgView1 = [UIView new];
- [bgView addSubview:bgView1];
- [bgView1 mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(37);
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.bottom.mas_equalTo(0);
- }];
- bgView1.backgroundColor = [UIColor whiteColor];
- bgView1.layer.cornerRadius = 16;
- bgView1.clipsToBounds = YES;
- //图片
- UIImageView *topImage = [UIImageView new];
- [bgView addSubview:topImage];
- [topImage mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(0);
- make.centerX.mas_equalTo(0);
- make.size.mas_equalTo(CGSizeMake(118, 82));
- }];
- topImage.image = [UIImage imageNamed:@"vqu_images_fate_window"];
- topImage.contentMode = UIViewContentModeScaleAspectFill;
- //
- NSString *contentString = @"1、牵线说明:\n相语欢颜平台将用大数据为你匹配优质男用户,优先将你的个人资料卡主动推送曝光给当前在线的优质异性;\n\n2、缘分同意:\n平台牵线匹配成功后,男生回复代表同意缘分,私聊由男生支付钻石;\n\n3、牵线秘籍:\n完善个人资料、通过真人认证、视频语音、互动即时回复、每日登录等活跃女神用户,可快速增加牵线曝光的次数哦。";
-
- CGRect fr = [contentString boundingRectWithSize:CGSizeMake(KScreenWidth-90., CGFLOAT_MAX) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15]} context:nil];
-
- NSString *strAmountText = contentString;
- NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:strAmountText attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:15],NSForegroundColorAttributeName: LZ273145Color}];
- [attributedString setAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:15],NSForegroundColorAttributeName: HexColorFromRGB(0xFE66A4)} range:[strAmountText rangeOfString:@"1、牵线说明:"]];
- [attributedString setAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:15],NSForegroundColorAttributeName: HexColorFromRGB(0xFE66A4)} range:[strAmountText rangeOfString:@"2、缘分同意:"]];
- [attributedString setAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:15],NSForegroundColorAttributeName: HexColorFromRGB(0xFE66A4)} range:[strAmountText rangeOfString:@"3、牵线秘籍:"]];
-
- UILabel *contextLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 62,fr.size.width, fr.size.height)];
- contextLabel.attributedText = attributedString;
- contextLabel.font = [UIFont systemFontOfSize:15];
- contextLabel.numberOfLines = 0;
- [bgView1 addSubview:contextLabel];
- //btn
- UIButton *iknowBtn = [UIButton new];
- [bgView1 addSubview:iknowBtn];
- [iknowBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.bottom.mas_equalTo(-20);
- make.left.mas_equalTo(36.5);
- make.right.mas_equalTo(-36.5);
- make.height.mas_equalTo(49);
- }];
- [iknowBtn setTitle:@"我知道了" forState:UIControlStateNormal];
- iknowBtn.layer.cornerRadius = 24.5;
- iknowBtn.clipsToBounds = YES;
- [iknowBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
- iknowBtn.titleLabel.font = [UIFont systemFontOfSize:16];
- [iknowBtn setBackgroundImage:[LCTools ColorImage:CGSizeMake(KScreenWidth-67.5*2, 49) FromColors:@[LZFFB5DBColor,LZFE66A4Color] ByGradientType:1] forState:UIControlStateNormal];
- [iknowBtn addTarget:self action:@selector(iknowBtnClick) forControlEvents:UIControlEventTouchUpInside];
-
- }
- -(void)iknowBtnClick{
- [self dismissViewControllerAnimated:YES completion:^{}];
-
- }
- @end
|