1
下面的示例应该用填充绘制笔画,但不是。哪里不对?根据苹果公司的文档,我正在使用负面价值来显示。如果我把它看成一个正值,那么文本就完全消失了。NSAttributedString使用NSStrokeColorAttributeName和NSStrokeWidthAttributeName绘制无笔画设置
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模拟器也适用于我 - 你是对的。但iOS 6不...为什么? – Vad
我发现了类似的问题:https://discussions.apple.com/thread/4873320 – Vad