原型单元太大(xcode)
原型单元中存在问题(请看图片) 这是我的代码:原型单元太大(xcode),xcode,Xcode,原型单元中存在问题(请看图片) 这是我的代码: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { groupsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"groupCell" forIndexPath:indexPath]; G
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
groupsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"groupCell" forIndexPath:indexPath];
Group *gr = [myGroupsListData objectAtIndex:indexPath.row];
cell.groupName.text = gr.name;
[cell.groupImage setImage:[UIImage imageNamed:gr.imageName]];
return cell;
}
确保TableView和TableViewCell的属性检查器中的行高相同
我猜groupsTableViewCell代表一个引用IB图片和文本的单元格,如果这是正确的,那么您可以在故事板中手动将单元格调整到所需的准确高度。第二个选项是调用tableView:heightForRowAtIndexPath:(UITableViewDelegate),但如果可以在情节提要中使用它,我不会使用它。另外,下次请使用谷歌:和