UILabel字体描边
2015-06-19 19:22
357 查看
继承UILabel,重写drawTextInRect方法:
- (void)drawTextInRect:(CGRect)rect { CGSize shadowOffset = self.shadowOffset; UIColor *textColor = self.textColor; CGContextRef c = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(c, 1); CGContextSetLineJoin(c, kCGLineJoinRound); CGContextSetTextDrawingMode(c, kCGTextStroke); self.textColor = [UIColor grayColor]; [super drawTextInRect:rect]; CGContextSetTextDrawingMode(c, kCGTextFill); self.textColor = textColor; self.shadowOffset = CGSizeMake(0, 0); [super drawTextInRect:rect]; self.shadowOffset = shadowOffset; }
相关文章推荐
- UIIimage 图片的截图和压缩
- GUI编程初步
- volley框架 出现at com.android.volley.Request.<init>
- Java基础 IO流 File Properties PrintWriter 序列流SequenceInputStream
- AndroidUI设计之 布局管理器 - 详细解析布局实现
- 重建索引:ALTER INDEX..REBUILD ONLINE vs ALTER INDEX..REBUILD
- 自定义UINavigationController push和pop动画
- 动态计算UITableViewCell高度详解
- GUI编程
- 雨松MOMO UGUI 之 全面理解图集与使用(三)
- UIButton的titleEdgeInsets和imageEdgeInsets属性
- GUI--事件处理
- Jquer Easyui Tree 异步加载
- Android应用开发多语言Value文件夹
- IOS prepareForSegue 多窗口切换学习
- uinavigationController pop 导致crash
- 【AmazeUI】底部导航条的改进
- iOS UITextField 设置内边距
- GPUImge
- cPickle.load(f) ValueError: insecure string pickle错误问题