Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何改变打孔颜色?_Ios_Objective C_Nsattributedstring - Fatal编程技术网

Ios 如何改变打孔颜色?

Ios 如何改变打孔颜色?,ios,objective-c,nsattributedstring,Ios,Objective C,Nsattributedstring,如何改变醒目的颜色 试试这个 NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"Old price"]; [str addAttribute:NSStrikethroughStyleAttributeName value:@2 range:NSMakeRange(0, [str le

如何改变醒目的颜色

试试这个

NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"Old price"];
[str addAttribute:NSStrikethroughStyleAttributeName
                        value:@2
                        range:NSMakeRange(0, [str length])];
试试这个

NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"Old price"];
[str addAttribute:NSStrikethroughStyleAttributeName
                        value:@2
                        range:NSMakeRange(0, [str length])];

唯一的问题…:)使用
nstrickethroughColorAttributeName
属性?唯一问题…:)使用
nstrickethroughColorAttributeName
属性?
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"Old price"];
NSRange range = NSMakeRange(0, [str length]);
[str addAttribute:NSStrikethroughStyleAttributeName value:@2 range:range];
[str addAttribute:NSStrikethroughColorAttributeName value:[UIColor greenColor] range:range];
[str addAttribute:NSForegroundColorAttributeName value:[UIColor greenColor] range:range];