Я пытаюсь добавить штрих к тексту и показать в UITextView
.Добавление внешнего строя в NSString в UITextView
Вот что я хочу.
На картинке (СОЗДАН ИЗ 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];
Я ВНУТРИ достижения эффекта. Как установить позицию в OUTSIDE
Возможно, с 'NSStrokeWidthAttributeName: [NSNumber numberWithFloat: +3.0],'? – Larme