Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.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 表视图行_Iphone_Uitableview - Fatal编程技术网

Iphone 表视图行

Iphone 表视图行,iphone,uitableview,Iphone,Uitableview,嘿,伙计们,当我展示talbeview时,有很多空行。。。如何使显示的行数完全等于[NSARRAY COUNT] 我敢肯定 - (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 返回它应该显示的正确行数您已经找到了正确的位置,并且确实已经得到了答案。下面是代码: - (NSInteger)tableView:(UITableView *)tableView number

嘿,伙计们,当我展示talbeview时,有很多空行。。。如何使显示的行数完全等于[NSARRAY COUNT]

我敢肯定

- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

返回它应该显示的正确行数

您已经找到了正确的位置,并且确实已经得到了答案。下面是代码:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [yourDataArrayName count];
}

显然,将表的实际名称替换为tableView,将数组的实际名称替换为DataArrayName。

将表的footerView设置为不呈现任何内容(但不为零)的视图


tableView.tableFooterView=[[UIView分配]初始化]自动释放]

你已经找到了正确的位置,并且已经找到了答案。下面是代码: 试试看,也许会有帮助

  • (NSInteger)表视图:(UITableView*)表视图行数节:(NSInteger)节{ 返回totalRows; } totalRows=(您需要的行数)

  • (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath {

    NSString*CellIdentifier=[NSString stringWithFormat:@“%i%i”,indexPath.row,indexPath.section]; UITableViewCell*单元格=[self.tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 如果(单元格==nil) { cell=[[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault重用标识符:CellIdentifier]自动释放]; cell.accessoryType=UITableViewCellAccessoryNone; cell.accessoryType=UITableViewCellAccessoryNone; cell.highlighted=是 }


请添加一些代码以获得任何类型的帮助。将tableView数据源方法和方法放在数组准备的位置。-(NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section{return[Quike.questions count];}尽管[questions count]返回5 tableView将显示多于5行的空额外行…我怎么能不显示它们?我的意思是…假设此方法返回5,但tableView显示多于5行,而这些额外行是空的…现在我希望此tableView正好显示5行如果数组中有5项,tableView将仅绘制5行。你确定没有包含空值/字典的数组元素吗?在返回行上放置一个断点,当应用程序执行暂停时,键入“print[yourArrayName count](不带引号)以确保它实际上只有5个元素。数组只有5个元素…这是footerview内容…无论如何感谢你的帮助:)