UILabel

我已经阅读并接受用户使用协议

2017-10-31  本文已影响7人  失忆的程序员

// 协议 label

UILabel *xieyiL = [[UILabel alloc] initWithFrame:CGRectMake(bottomView.height/3, 0, bottomView.width - 40 - bottomView.height/3, bottomView.height/3)];

xieyiL.textAlignment = NSTextAlignmentLeft;

xieyiL.font = Font(12);

NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"我已经阅读并接受用户使用协议"];

[str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12.0] range:NSMakeRange(8, 6)];

[str addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(8, 6)];

//加下划线

[str addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(8, 6)];

xieyiL.attributedText = str;

[bottomView addSubview:xieyiL];

UIButton *xieyiBtn = [[UIButton alloc] initWithFrame:CGRectMake(bottomView.height/3, 0, bottomView.width - 40 - bottomView.height/3, bottomView.height/3)];

[xieyiBtn addTarget:self action:@selector(bottomBtnClick:) forControlEvents:(UIControlEventTouchUpInside)];

xieyiBtn.tag = 4001;

[bottomView addSubview:xieyiBtn];

上一篇 下一篇

猜你喜欢

热点阅读