You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

71 lines
2.9 KiB

//
// SignRuleViewController.m
// tongxin
//
// Created by ecell on 2023/3/31.
// Copyright © 2023 xTT. All rights reserved.
//
#import "SignRuleViewController.h"
@interface SignRuleViewController ()
@end
@implementation SignRuleViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.title = @"签到规则";
self.view.backgroundColor = tabViewBG;
UILabel *msgLabel = [UILabel new];
msgLabel.textColor = KKGrey121;
msgLabel.numberOfLines = 0;
msgLabel.textAlignment = NSTextAlignmentLeft;
msgLabel.font = FontADA_(15);
msgLabel.attributedText = [self labelFontSize: @"1.签到对象\n  所有用户。\n2.签到方式\n  点击“签到”按钮进入签到日历页面,即完成当日签到。\n3.签到奖励\n  每日签到都可以获得对应积分奖励,连续签到奖励更多,第一天签到奖励1分、连续签到第二天奖励2分、连续签到第三天奖励3分,以此类推,连续签到第七天及以上都奖励7分,若中途签到中断,则重新计算,连续签到每月为一个周期,每月1号将重置连续签到天数及奖励。"];
[self.view addSubview:msgLabel];
[msgLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.view).offset(iPhoneX_NavHeight+20);
make.left.right.equalTo(self.view).inset(20);
}];
}
- (NSAttributedString *)labelFontSize:(NSString *)text
{
NSRange symbolRange = [text rangeOfString:@"1.签到对象"];
NSRange symbolRange1 = [text rangeOfString:@"2.签到方式"];
NSRange symbolRange2 = [text rangeOfString:@"3.签到奖励"];
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:text];
if (symbolRange.location != NSNotFound) {
[string addAttribute:NSFontAttributeName value:FontBoldADA_(15) range:NSMakeRange(symbolRange.location, symbolRange.length)];
}
if (symbolRange1.location != NSNotFound) {
[string addAttribute:NSFontAttributeName value:FontBoldADA_(15) range:NSMakeRange(symbolRange1.location, symbolRange1.length)];
}
if (symbolRange2.location != NSNotFound) {
[string addAttribute:NSFontAttributeName value:FontBoldADA_(15) range:NSMakeRange(symbolRange2.location, symbolRange2.length)];
}
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineSpacing = 15;
paragraphStyle.alignment = NSTextAlignmentLeft;
[string addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, string.length)];
return string;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end