12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- //
- // BuyVipTopView.m
- // 隐私保护
- //
- // Created by APPLE on 2023/8/25.
- //
- #import "BuyVipTopView.h"
- #import <Masonry.h>
- @implementation BuyVipTopView
- @synthesize titleLabel;
- @synthesize vaildTimeLabel;
- /*
- // Only override drawRect: if you perform custom drawing.
- // An empty implementation adversely affects performance during animation.
- - (void)drawRect:(CGRect)rect {
- // Drawing code
- }
- */
- - (id)initWithFrame:(CGRect)frame{
- self = [super initWithFrame:frame];
-
- [self drawAnyView];
-
- return self;
- }
- - (void)drawAnyView{
- titleLabel = [[UILabel alloc] init];
- [self addSubview:titleLabel];
- [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(30.f);
- make.left.mas_equalTo(20.f);
- make.height.mas_equalTo(33.f);
- }];
- [titleLabel setTextColor:HWFFFFFFColor];
- NSString *leftStr0 = NSLocalizedString(@"buy_vip_top_title",nil);
- NSString *rightStr0 = @"VIP";
- NSString *showStr = [leftStr0 stringByAppendingString:rightStr0];
- NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:showStr attributes: @{NSFontAttributeName: [UIFont systemFontOfSize:16.f]}];
- [string addAttributes:@{NSFontAttributeName: [UIFont boldSystemFontOfSize:24.f]} range:NSMakeRange(leftStr0.length, rightStr0.length)];
- [titleLabel setAttributedText:string];
-
- vaildTimeLabel = [[UILabel alloc] init];
- [self addSubview:vaildTimeLabel];
- [vaildTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.bottom.mas_equalTo(-28.f);
- make.right.mas_equalTo(-20.f);
- make.left.mas_equalTo(33.f);
- }];
- [vaildTimeLabel setTextAlignment:(NSTextAlignmentRight)];
- [vaildTimeLabel setTextColor:HWFFFFFFColor];
- [vaildTimeLabel setFont:[UIFont systemFontOfSize:12]];
- NSString *leftStr = NSLocalizedString(@"buy_vip_top_vaildtime",nil);
- NSString *timeStr = @"2023-04-22";
- [vaildTimeLabel setText:[leftStr stringByAppendingString:timeStr]];
- }
- @end
|