Ios NSAttributeString使用NSStrokeColorAttributeName和NSStrokeWidthAttributeName集不绘制笔划

Ios NSAttributeString使用NSStrokeColorAttributeName和NSStrokeWidthAttributeName集不绘制笔划,ios,objective-c,nsattributedstring,Ios,Objective C,Nsattributedstring,下面的示例应与“填充”一起绘制笔划,但实际情况并非如此。怎么了?根据苹果的文档,我使用负值让斯托克出现。如果我将其设为正值,则文本将完全消失 UITextView *rte = [[UITextView alloc]initWithFrame: CGRectMake(50,50,100,100)]; [self.view addSubview:rte]; NSDictionary *typingAttributes = @{

下面的示例应与“填充”一起绘制笔划,但实际情况并非如此。怎么了?根据苹果的文档,我使用负值让斯托克出现。如果我将其设为正值,则文本将完全消失

UITextView *rte = [[UITextView alloc]initWithFrame:
                                  CGRectMake(50,50,100,100)];

[self.view addSubview:rte];
NSDictionary *typingAttributes = @{
                                   NSFontAttributeName: [UIFont fontWithName:@"Helvetica-Bold" size:20.0f],
                                   NSForegroundColorAttributeName : [UIColor redColor],
                                   NSStrokeColorAttributeName : [UIColor yellowColor],
                                   NSStrokeWidthAttributeName : [NSNumber numberWithFloat:-2.0]
                                   };
NSAttributedString *str = [[NSAttributedString alloc]
                           initWithString:@"Enter text here..."
                           attributes:typingAttributes];
rte.attributedText = str;

我已在iOS 7.0.3模拟器中试用了您的代码,结果如下:

它在iOS 6中不起作用。我认为这是一个错误。


很抱歉,我没有解释为什么在iOS 6中它不工作。

我在iOS 7.0.3模拟器中尝试了你的代码,结果是:

它在iOS 6中不起作用。我认为这是一个错误。


很抱歉,我没有任何解释为什么在iOS 6中它不工作。

iOS 7模拟器也适用于我-你是对的。但是iOS 6没有。。。为什么?iOS 7模拟器对我也适用-你是对的。但是iOS 6没有。。。为什么?