iOS--UILabel上画横线

/**
 *  在UIlabel的子类里实现
 *
 */
- (void)drawRect:(CGRect)rect
{
    [super drawRect:rect];
    
    [self.textColor set];
    CGFloat w = rect.size.width;
    CGFloat h = rect.size.height;
    /**
     *  UIRectFill
     *  Fills the specified rectangle with the current color
     *  用颜色填充指定的区域
     */
    UIRectFill(CGRectMake(0, h * 0.3, w, 1));
}

 

posted @ 2016-04-12 14:30  Colaless  阅读(637)  评论(0编辑  收藏  举报