今早发线模拟器iOS10.3.1的UIlabel中的 中划线没有了类似这样的:
第一种方式:
NSString*string =@“¥200.00”;
NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] initWithString:string];
[attributeString setAttributes:@{NSStrikethroughStyleAttributeName: [NSNumbernumberWithInteger:NSUnderlineStyleSingle]} range:NSMakeRange(0,string.length)];
_priceLabel.attributedText= attributeString;
NSString*string =@“¥200.00”;
NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] initWithString:string];
[attributeString setAttributes:@{NSStrikethroughStyleAttributeName: [NSNumbernumberWithInteger:NSUnderlineStyleSingle], NSBaselineOffsetAttributeName : @(NSUnderlineStyleSingle)} range:NSMakeRange(0,string.length)];
_priceLabel.attributedText= attributeString;
Y(^o^)Y
网友评论