【发布时间】:2014-04-02 07:43:21
【问题描述】:
如何向以编程方式创建的UIlabel 文本添加填充?
NSArray *collectionViewArrayTitle = _titleArray[collectionView.index];
NSString *title= collectionViewArrayTitle[indexPath.item];
newslabel =[[UILabel alloc] initWithFrame:CGRectMake(0, 80, 130, 50)];
_newslabel.textColor=[UIColor whiteColor];
_newslabel.backgroundColor=[UIColor blackColor] ;
_newslabel.alpha=1.0f;
_newslabel.text=title;
_newslabel.tag=collectionView.index;
_newslabel.lineBreakMode=NSLineBreakByTruncatingTail;
_newslabel.numberOfLines=4;
【问题讨论】: