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