iPhone-在编辑时更改单元格的缩进行 [英] iPhone - Change indentation row for a cell while editing

查看:43
本文介绍了iPhone-在编辑时更改单元格的缩进行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在编辑UITableView时更改自定义UITableViewCell的内容(即图像,按钮和标签)的缩进.

I'm trying to change the indentation for a custom UITableViewCell's content (namely, a image, a button and a label) when a UITableView is being edited.

我试图像这样更改单元格的压痕宽度和水平

I tried changing the cell's indentation width and level like this

[cellToCustomize setIndentationLevel:1];
[cellToCustomize setIndentationWidth:20];

这让我无处可去.

我还实现了

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

功能.

再次,什么也没有.

我想增加缩进级别,比方说...加倍.

I want to increase the indentation level, let's say... to the double.

有人知道怎么做吗?

谢谢!

推荐答案

我在缩进中没有显示编辑模式的问题,但是我发现我已经向单元格添加了子视图,而不是cell.contentView-应将所有组件添加为cell.contentView的子视图.

I was having problem with indentation not showing for editing mode, but I figured out, that I've added subviews to cell, instead of cell.contentView - all components should be added as subview of cell.contentView .

这篇关于iPhone-在编辑时更改单元格的缩进行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆