- - (void)drawRect:(CGRect)rect
- {
- [super drawRect:rect];
- CGContextRef ctx = UIGraphicsGetCurrentContext();
- CGSize fontSize =[self.text sizeWithFont:self.font
- forWidth:self.bounds.size.width
- lineBreakMode:UILineBreakModeTailTruncation];
iOS---UILabel使用drawRect添加下划线
最新推荐文章于 2020-12-24 11:18:40 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)