iphone - 更改 UILabel 背景颜色

标签 iphone ios uilabel

我的代码是

UILabel *pTeamAlreadybl=[[UILabel alloc]initWithFrame:CGRectMake(110, 275,180,30)];

pTeamAlreadybl.text=@" Team already?";
pTeamAlreadybl.font=[UIFont boldSystemFontOfSize:16];
pTeamAlreadybl.textAlignment=UITextAlignmentLeft;
pTeamAlreadybl.textColor=[UIColor colorWithRed:61.0/255.0 green:61.0/255.0 blue:61.0/255.0 alpha:0.6];
pTeamAlreadybl.shadowColor = [UIColor colorWithWhite:1.0 alpha:0.7];

如何更改标签的背景颜色?

最佳答案

你错过了

pTeamAlreadybl.backgroundColor=[UIColor anycolor];

写这段代码

关于iphone - 更改 UILabel 背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6955339/

相关文章:

iPhone SDK : UIView dealloc not called. 为什么?

iphone - 刷新 didSelectRowAtIndexPath 委托(delegate)上的 viewForFooterInSection

ios - 消息发送到已释放的实例

iphone - 如何在社交网站上分享我的文字(如表情符号)?

ios - 如何在 cocos2d 中创建带编号的有序文本?

iOS 添加带有动画句号的加载文本

ios - 什么是 UILabel 默认 shadowRadius?

swift - 使用 AttributedString 截断轨迹

ios - 不能对 PFObject 上的键或值使用 nil。使用 NSNull 作为值

ios - UIButton 文本不会保持变化