繼續我的最後一個問題UITableViewCell custom cell using IB loading data最好爲新問題啓動一個新的問題!UITableCell自定義單元格不佔用自定義單元格的高度
我的自定義單元加載中(在IB設計)
下面是自定義單元格我的XIB文件:
而且繼承人如何加載在我的表:
因此,它不會加載自定義單元格的大小屬性(但它將文本加載到正確的標籤和它的加載右邊的藍色箭頭從筆尖)
代碼繼承人如何填充表:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
ViewRoutesCell * aCell = (ViewRoutesCell *)[tableView dequeueReusableCellWithIdentifier:@"ViewRoutesCell"];
if (aCell == nil)
{
NSArray *arr = [[NSBundle mainBundle] loadNibNamed:@"ViewRoutesCell" owner:self options:nil];
for (NSObject *anObj in arr) {
if([anObj isKindOfClass:[ViewRoutesCell class]]) {
aCell = (ViewRoutesCell *)anObj;
aCell.lblRouteText.text = [arryRouteText objectAtIndex:indexPath.row];
aCell.lblRouteImage.text = [arryRouteImage objectAtIndex:indexPath.row];
}
}
}
return aCell;
}
我在做什麼錯裝電池?
湯姆
只是設置你的tableview的rowHeight屬性 ''[self.tableView setRowHeight:30];'或任何你的身高應該是 – Maggie