Add shadow to text in UITextView


    NSShadow * shadow = [[NSShadow alloc] init];
    shadow.shadowColor = [UIColor blackColor];
    shadow.shadowOffset = CGSizeMake(1, 2);
  
    NSDictionary * textAttributes =  @{
                                       NSForegroundColorAttributeName : [UIColor blueColor],
                                       NSShadowAttributeName          : shadow,
                                       NSFontAttributeName            : [UIFont boldSystemFontOfSize:20]
                                       };
  
    txtView.attributedText = [[NSAttributedString alloc] initWithString:@"Go to Heaven for the climate, Hell for the company." attributes:textAttributes];



Comments

Popular posts from this blog

Scroll UITextField above Keyboard in a UITableView OR UIScrollView in Swift and Objective C

Reverting all Xcode settings to default settings

CGRectIntegral