We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
` WS(ws); //self 的弱引用
NSMutableArray *ranges = [NSMutableArray array]; // 特殊字符的Range集合,修改文字颜色用 NSString *string = @"点击提交表明您已经阅读并同意\"条款与条件\"和\"隐私政策\""; // 特殊字符的Range NSRange range1 = [string rangeOfString:@"条款与条件"]; NSRange range2 = [string rangeOfString:@"隐私政策"]; [ranges addObject:[NSValue valueWithRange:range1]]; [ranges addObject:[NSValue valueWithRange:range2]]; // 转换成富文本字符串 NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string]; [attrStr addAttributes:@{NSFontAttributeName : [UIFont systemFontOfSize:11.f]} range:NSMakeRange(0, string.length)]; // 最好设置一下行高,不设的话默认是0 NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init]; style.lineSpacing = 0; [attrStr addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0, string.length)]; // 给指定文字添加颜色 for (NSValue *rangeVal in ranges) { [attrStr addAttributes:@{NSForegroundColorAttributeName : DefaultColor} range:rangeVal.rangeValue]; } //居中 NSMutableParagraphStyle *sty = [[NSMutableParagraphStyle alloc] init]; sty.alignment = NSTextAlignmentCenter; [attrStr addAttribute:NSParagraphStyleAttributeName value:sty range:NSMakeRange(0, string.length)]; _fuWuYuTiaoKuan.attributedText = attrStr; _fuWuYuTiaoKuan.enabledTapEffect = NO; // 给指定文字添加点击事件,并设置代理,代理中监听点击 [_fuWuYuTiaoKuan yb_addAttributeTapActionWithStrings:@[@"条款与条件",@"隐私政策"] tapClicked:^(NSString *string, NSRange range, NSInteger index) { //自定义代码 }];
`
The text was updated successfully, but these errors were encountered:
没问题啊?是不是你这个label本身还有别的点击事件什么的?
Sorry, something went wrong.
嗯,找到问题了,在全屏幕中加个了Tap手势,应该是被拦截,现在已经解决了
WS(ws); [_tableView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(ws.view.mas_top).with.mas_equalTo(64); make.left.equalTo(ws.view.mas_left); make.right.equalTo(ws.view.mas_right); make.bottom.equalTo(ws.view.mas_bottom).with.mas_equalTo(48+30); }]; 这个是新发现的问题
WS(ws); [_tableView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(ws.view.mas_top).with.mas_equalTo(64); make.left.equalTo(ws.view.mas_left); make.right.equalTo(ws.view.mas_right); make.bottom.equalTo(ws.view.mas_bottom).with.mas_equalTo(48+30); }];
你的子视图都已经超出父视图的边界了,边界外的当然触发不了了啊
No branches or pull requests
`
WS(ws); //self 的弱引用
`
The text was updated successfully, but these errors were encountered: