这是怎么发生的:UITableView中的iOS UITableViewCell
这是我的tableView代码,我使用的是costom单元格:这是怎么发生的:UITableView中的iOS UITableViewCell,ios,uitableview,Ios,Uitableview,这是我的tableView代码,我使用的是costom单元格: - (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *IOsCell = @"IOsCell"; IOsCellViewController *cell = [tableView dequeueReusableCellWit
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *IOsCell = @"IOsCell";
IOsCellViewController *cell = [tableView dequeueReusableCellWithIdentifier:IOsCell];
if ( cell == nil )
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"IOsCellViewController" owner:self options:nil];
cell=[nib objectAtIndex:0];
}
我的costom单元视图中有几个标签:
我正在挣扎的部分就是看起来像照片
在底部
在UITableView中有一个单元格视图
我不知道这是怎么发生的,也不知道如何解决
我希望我足够清楚。非常感谢您的帮助
谢谢。试试这个:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return height_of_your_cell;
}
两项建议:
表格视图:numberOfRowsInSection
返回的数字正确(从您的屏幕截图来看,该部分至少应返回4)tableView:heightforrowatinexpath
返回该自定义单元格的正确高度还有一个经典的例子,我已经被烧掉了好几次:确保您的委托连接正确,以便这些方法实际上被调用。您在tableFooterView属性中有一个UIView。它可能来自interface builder。您可以通过执行以下操作在表视图控制器的
-viewDidLoad
中删除它
self.tableView.tableFooterView = nil;
-(CGFloat)tableView:(UITableView*)tableView行的高度index path:(nsindepath*)indepath&-(NSInteger)tableView:(UITableView*)tableView行数section:(NSInteger)section这两个函数造成了这个问题我想,我设置了tableView 44最后一行的高度,但其他的高度都是150,最后一行将调用从webService重新加载更多数据的函数。