标签:
UILabel *testLabel = [[ UILabel alloc] initWithFrame:CGRectMake(10, 100, 200, 100)]; testLabel.numberOfLines = 0; NSString* strText = @"测试画删除线测试画删除线测试画删除线测试画删除线测试画删除线"; NSMutableAttributedString *content = [[NSMutableAttributedString alloc]initWithString:strText]; NSRange contentRange = {0,[content length]}; [content addAttribute:NSStrikethroughStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:contentRange]; testLabel.attributedText = content; [self.view addSubview:testLabel];
标签:
原文地址:http://www.cnblogs.com/wlsxmhz/p/5691621.html