gpt4 book ai didi

ios - 将 UITableViewCell 向右移动一位

转载 作者:行者123 更新时间:2023-11-30 14:17:37 26 4
gpt4 key购买 nike

我使用自定义 UIView 作为我的表格标题,并且该标题与索引 0 处的单元格重叠。

我正在尝试将表格 View 的所有单元格移动到右侧的一个位置。即

第 0 个索引处的单元格应移至第 1 个索引

第一个索引处的单元格应转移到第二个索引

直到有cell+1个cell

代码:cellForRowAtIndexPath

    .....

if (indexPath.row == 0){
cell.hidden = true
for(var index = indexPath.row-1; index >= 0; index--){
indexPath.indexAtPosition(index)+1 = indexPath.indexAtPosition(index) }

错误:无法将类型“(Int)”的值分配给值类型“Int”

谢谢。

最佳答案

只需使用增加标题的高度

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;

然后它不应该与第一个单元格重叠,因此您不需要移动单元格

关于ios - 将 UITableViewCell 向右移动一位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30931447/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com