[iOS] 文字描边方法
来源:互联网 发布:画漫画的软件 编辑:程序博客网 时间:2024/06/16 08:07
继承UILabel然后重写一下方法
- (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 whiteColor]; [super drawTextInRect:rect]; CGContextSetTextDrawingMode(c, kCGTextFill); self.textColor = textColor; self.shadowOffset = CGSizeMake(0, 0); [super drawTextInRect:rect]; self.shadowOffset = shadowOffset;}
原帖地址:http://stackoverflow.com/questions/1103148/how-do-i-make-uilabel-display-outlined-text#
0 0
- [iOS] 文字描边方法
- 文字描边方法
- ios UILabel文字描边
- IOS UILabel 文字描边详解
- [IOS 开发] UILabel文字描边
- css实现文字描边方法
- iOS画矩形、直线、文字的方法
- IOS下将文字转成图片方法
- iOS画矩形、直线、文字的方法
- iOS计算文字尺寸的方法
- iOS UITextField监控输入文字变化方法
- 简便方法IOS中自适应文字高度
- IOS下将文字转成图片方法
- iOS图片添加阴影和文字描边
- Flash文字描边的一种简便方法
- IOS 中UIAlertView中获取自定义文本框文字方法
- IOS-将长文字转化成图片方法
- iOS将文字添加到图片上的方法
- POJ 3154 贪心
- c语言==简介及相关常识(3)
- 经典蓝牙连接-蓝牙音箱或蓝牙耳机
- android学习14#--Handler消息传递机制实例应用
- scrollview嵌套gridview:scrollview不是置顶显示
- [iOS] 文字描边方法
- 关于android报表的制作
- 打电话,发短息,打开网页
- 求两个数的最大公约数
- Matlab BMP图像如何能运行在处理RAW图像程序中
- Android开发者应该使用FlatBuffers替代JSON?
- BZOJ 1115: [POI2009]石子游戏Kam
- 119. Pascal's Triangle II
- ACM刷题之HDU————Hat's Fibonacci