我有一個UITableView,我正在加載數據。標題標題顯示正常,但cell.textlabel.text
未顯示任何內容。 (注意顏色不是白色時,它也不顯示)但我可以在AlertView中獲取cell.textlabel.text
的值。UITableViewCell textlabel內容不顯示任何東西
任何幫助?
代碼:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"cellT";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
cell.textLabel.text = [[theTArray objectAtIndex:indexPath.section]objectAtIndex:0];
// Configure the cell...
cell.textLabel.textColor = [UIColor blackColor];
return cell;
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
return [[theTArray objectAtIndex:section]objectAtIndex:1];
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
NSString *message = [NSString stringWithFormat:@"%@", cell.textLabel.text];
NSString *title = [[theTArray objectAtIndex:indexPath.section]objectAtIndex:1];
UIAlertView *theAlert = [[UIAlertView alloc] initWithTitle:title message:message delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[tableView reloadData];
[theAlert show];
}
照片管理: http://imgur.com/a/lcwyf
試過了,沒有工作:( –