【发布时间】:2014-09-17 05:50:21
【问题描述】:
如何编写代码来为 uilabel 数组进行水平滚动
例子:
NSArray *tagsArray = [NSJSONSerialization JSONObjectWithData:someData options:kNilOptions error:&error];
if ([tagsArray count]>0) {
for (int i=0; i<[tagsArray count]; i++) {
CGRect ansCountValueRectangle13 = CGRectMake(80*i+10,110,80,30);
UILabel *_tagsValue = [[UILabel alloc] initWithFrame:ansCountValueRectangle13];
_tagsValue.clipsToBounds=YES;
_tagsValue.tag=250;
_tagsValue.text = [tagsArray objectAtIndex:i];
_tagsValue.layer.cornerRadius=15.0;
_tagsValue.backgroundColor = [UIColor orangeColor];
_tagsValue.textAlignment = NSTextAlignmentCenter;
_tagsValue.textColor=[UIColor whiteColor];
_tagsValue.font = [UIFont boldSystemFontOfSize:16];
[testing addSubview: _tagsValue];
}
}
为此,我必须添加UIScrollView,这些代码写在tableViewCell 内,我希望每个tableview 行都有Horizontal Scroll 和UILabel
【问题讨论】:
标签: ios objective-c uitableview uiscrollview uilabel