摘要:
#import <Foundation/Foundation.h>@interface UnderlineUILabel : UILabel{}@end#import "UnderlineUILabel.h"#import<QuartzCore/QuartzCore.h>@implementation UnderlineUILabel-(id)initWithFrame:(CGRect)frame{if(self = [super initWithFrame:frame]){}return self;}-(void)drawRect:(CGRect) 阅读全文
摘要:
- (void)drawRect:(CGRect)rect{CGContextRef ctx = UIGraphicsGetCurrentContext();const CGFloat* colors = CGColorGetComponents(self.textColor.CGColor);CGContextSetRGBStrokeColor(ctx, colors[0], colors[1], colors[2], 1.0); // RGBACGContextSetLineWidth(ctx, 1.0f);CGSize tmpSize = [self.text sizeWithFont: 阅读全文