【发布时间】:2014-06-02 14:49:12
【问题描述】:
我有一个表格视图,我想在其中填充一些推文。我有一个文本视图,我使用它在每个表格视图单元格中填充推文的内容。但是,此文本视图已被覆盖。有人可以看看我下面的代码,如果我犯了任何错误,请告诉我?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FeedCell" forIndexPath:indexPath];
NSDictionary *tweet = tweetArray[indexPath.row];
NSString *tweetText = tweet[@"text"];
CGSize stringSize = [tweetText sizeWithFont:[UIFont boldSystemFontOfSize:15] constrainedToSize:CGSizeMake(320, 9999) lineBreakMode:UILineBreakModeWordWrap];
textV=[[UITextView alloc] initWithFrame:CGRectMake(5, 5, 290, stringSize.height+5)];
textV.font = [UIFont systemFontOfSize:15.0];
textV.text = tweetText;
textV.textColor = [UIColor blackColor];
textV.editable = NO;
[cell.contentView addSubview:textV];
return cell;
}
【问题讨论】:
标签: ios7 uitableview uitextview