Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.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
原型单元太大(xcode)_Xcode - Fatal编程技术网

原型单元太大(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),但如果可以在情节提要中使用它,我不会使用它。另外,下次请使用谷歌:和