【发布时间】:2015-01-14 14:15:44
【问题描述】:
我有一个文件夹的表格视图,当用户点击文件夹时,它会显示子文件夹,名称移动 20 像素以获得“子图形效果”。现在,切换到Autolayout,我无法使用代码以编程方式移动UIView 的元素:
- (void) configureView {
if (self.cellMode != NVCellModeSelect) {
[self setBackgroundColor:[NVGlobals homeCellBackgroundColor]];
//Indenting label
CGRect r = self.titleLabel.frame;
r.origin.x = kLabelsInitialX + self.item.level*10;
self.titleLabel.frame = r;
//Indenting folder
r = self.thumbnail.frame;
r.origin.x = kFolderInitialX + self.item.level*10;
self.thumbnail.frame = r;
//Indent triangle
r = self.triangleIcon.frame;
r.origin.x = kTriangleInitialX + self.item.level*10;
self.triangleIcon.frame = r;
}
}
但现在它似乎不起作用。如何使用 autoLayot 以编程方式在 UITableViewCell 中移动元素?
【问题讨论】:
标签: ios iphone cocoa-touch autolayout