UILabel显示富文本



UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(30, 90, 150, 50)];
    NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
    attributes[NSStrokeColorAttributeName] = [UIColor blueColor];
    attributes[NSStrokeWidthAttributeName] = @6;

    NSShadow *shadow = [[NSShadow alloc] init];
    shadow.shadowColor = [UIColor redColor];
    shadow.shadowBlurRadius = 5;
    shadow.shadowOffset = CGSizeMake(10, 10);

    attributes[NSShadowAttributeName] = shadow;

    label.attributedText = [[NSAttributedString alloc] initWithString:@"我的地盘" attributes:attributes];
    [self.view addSubview:label];


你可能感兴趣的:(项目总结)