Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/44.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone UITableView单元格文本未显示?_Iphone_Objective C_Uitableview - Fatal编程技术网

Iphone UITableView单元格文本未显示?

Iphone UITableView单元格文本未显示?,iphone,objective-c,uitableview,Iphone,Objective C,Uitableview,我没有看到UITableView的文本显示。。事实上,TableView根本不在屏幕上,因为我无法选择空行 奇怪的是,我在CellForRowatineXpath中的登录显示了预期的数据,但我在屏幕上没有看到任何数据 -(void)bindFriendsToTable:(NSArray *)friends{ NSLog(@"friends : %@",friends); [sections removeAllObjects]; [sectionRows removeAllObjects];

我没有看到UITableView的文本显示。。事实上,TableView根本不在屏幕上,因为我无法选择空行

奇怪的是,我在CellForRowatineXpath中的登录显示了预期的数据,但我在屏幕上没有看到任何数据

 -(void)bindFriendsToTable:(NSArray *)friends{
NSLog(@"friends : %@",friends);
[sections removeAllObjects];
[sectionRows removeAllObjects];

[sections addObject:@"Friends"];
[sectionRows setObject:friends forKey:@"Friends"];  

[self.tableView reloadData];
HideActivityIndicator();
}

}


我继承了一个基类,它是一个UITableViewController,就像我在项目中的其他十几个屏幕一样。你知道我为什么看不到tableView吗?

你的字体颜色和背景颜色一样吗?如果将accessoryType设置为复选标记,是否会显示

      cell.accessoryType = UITableViewCellAccessoryCheckmark;

你们有标题部分吗?如果是,请确保返回heightForHeaderInSection的值:

-(float)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
      return 66;
}
我认为你应该离开 [单元格设置选择样式:UITableViewCellSelectionStyleNone]; 然后试试看。
并在单元格中显示另一个静态字符串以检查问题。

感谢您的响应。没有,我没有看到附件。我试着注释掉selectionStyle的内容,但无法选择行。嘿@Liam使用它我可以看到复选标记。但还是没有短信。。甚至更改单元格的背景色和文本标签:/EDIT:刚刚发现表格的左侧在视图后面,因此我认为单元格是空的,但不是空的。太棒了!在文档中,“选择样式是一个背景视图常量,用于确定选定单元格时的颜色。默认值为UITableViewCellSelectionStyleBlue。有关有效常量的说明,请参阅“单元格选择样式”。”。
-(float)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
      return 66;
}