小编Jon*_*man的帖子

单元格未出现在tableview中

我有一个历史页面,这是一个包含5行的UItableview.我已将原型单元格设置为我想要的规格,并将此文本添加到相应的historyviewcontroller.h文件中:

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
   return 5;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath           *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HistoryItem"];
return cell;
} 
Run Code Online (Sandbox Code Playgroud)

当我运行应用程序时,我没有看到任何单元格.我显然错过了一些东西,但我不太明白.

iphone uitableview ios

2
推荐指数
1
解决办法
350
查看次数

标签 统计

ios ×1

iphone ×1

uitableview ×1