iphone – label.layer.borderColor = …无法正常工作(Xcode 4.3
发布时间:2020-12-14 19:51:38 所属栏目:百科 来源:网络整理
导读:我在一个类中工作,该类是UITableViewCell的子类,并且在.h中声明了firstLabel和secondLabel属性,并且在.m中是@synthesize.当我以编程方式格式化UILabels时,我尝试在firstLabel周围设置边框.根据 this question给出的答案,我试图在我的项目中做同样的事情. fir
我在一个类中工作,该类是UITableViewCell的子类,并且在.h中声明了firstLabel和secondLabel属性,并且在.m中是@synthesize.当我以编程方式格式化UILabels时,我尝试在firstLabel周围设置边框.根据
this question给出的答案,我试图在我的项目中做同样的事情.
firstLabel.layer.borderColor = [UIColor blackColor].CGColor; 我键入firstLabel.layer后,问题是它无法识别它.并点击’esc'(获得完成列表)Xcode没有任何结果.问题是什么? 注意:如果我输入 firstLabel.textAlignment = UITextAlignmentCenter; 它工作正常,行为符合预期. 解决方法
您需要导入QuartzCore标头. #import< QuartzCore / QuartzCore.h>
(并且不要忘记添加QuartzCore库,否则在尝试构建时会出现链接器错误). (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |