在UITableView上显示徽章信息 [英] display badge info on UITableView

查看:129
本文介绍了在UITableView上显示徽章信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在UITableView行显示徽章信息,如下图所示

I hope to display the badge info on the row UITableView like the picture shown below

我尝试使用以下代码:

UILabel *labelCell1 =[ [UILabel alloc]init];
labelCell1.frame = CGRectMake(160.9f,10.0f,60.0f,30.0f) ;
[labelCell1 setBackgroundColor:[UIColor 
    colorWithPatternImage:[[UIImage imageNamed:@"block.png"] 
    stretchableImageWithLeftCapWidth:0.0 topCapHeight:0.0]]]; 

但我无法获得上图所示的圆形块结果。

but I can not get result of round block shown in the picture above.

推荐答案

抛弃你的代码,不要重新发明轮子。这已由几个使其成为开源的人完成。 此处是一个,这里是另一个。

Throw out your code, don't reinvent the wheel. This has been done by several people who have made it open source. Here is one, here is another.

这篇关于在UITableView上显示徽章信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆