缩进在UITableView(ios6)中不起作用

时间:2013-02-20 03:20:04

标签: iphone ios ipad ios6

根据等级,单元格没有缩进。

我在cellForRowAtIndexPath中配置了缩进宽度。

- (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath{

            NSInteger theLevel=0;
            if ( indexPath.row==1) {
                theLevel=5;
            }
            return theLevel;
        }

在下面的图像中,我根据其级别更改了按钮的框架和标签。

enter image description here

1 个答案:

答案 0 :(得分:0)

如果您已将子视图添加到单元格,则需要设置子视图的自动调整蒙版,以便在更改contentView大小时重新定位它们。

请查看此answer

相关问题