3
我正在嘗試將一個筆劃添加到文本並在UITextView
中顯示。在UITextView中將外部筆觸添加到NSString中
這是我想要的。
圖片中(CREATED FROM PHOTOSHOP)使用了相同的字體,第一個使用了Postion "OUTSIDE"
,底部文本使用了position INSIDE
。
我使用下面的代碼在Objective-C
NSShadow * shadow = [[NSShadow alloc] init];
shadow.shadowColor = [UIColor blackColor];
shadow.shadowOffset = CGSizeMake(0, 0);
NSDictionary * textAttributes =
@{ NSForegroundColorAttributeName : [UIColor whiteColor],
NSShadowAttributeName : shadow,
NSStrokeColorAttributeName : [UIColor blackColor],
NSStrokeWidthAttributeName : [NSNumber numberWithFloat:-3.0],
NSFontAttributeName : [UIFont fontWithName:@"UbuntuCondensed-Regular" size:40] };
textTitleResult.attributedText = [[NSAttributedString alloc] initWithString:textTitle.text
attributes:textAttributes];
我實現INSIDE效果。我怎麼能設置位置到外面
也許''NSStrokeWidthAttributeName:[NSNumber numberWithFloat:+3.0],'? – Larme