我使用PFQueryTableViewController从PFObject中检索数据。这最终是成功的,但是textLabel和detailTextLabel是最重要的。图片下方是我的单元格代码。当我将这个customCell用于普通的TableView时,文本标签间隔得恰当。
- (void)layoutSubviews {
[super layoutSubviews];
self.imageView.frame = CGRectMake(1,1,69,69);
float limgW = self.imageView.image.size.width;
if(limgW > 0) {
self.textLabel.frame = CGRectMake(74,self.textLabel.frame.origin.y,self.textLabel.frame.size.width,self.textLabel.frame.size.height);
self.detailTextLabel.frame = CGRectMake(74,self.detailTextLabel.frame.origin.y,self.detailTextLabel.frame.size.width,self.detailTextLabel.frame.size.height);
}
}
答案 0 :(得分:1)
您可以像这样管理框架:
self.textLabel.frame = CGRectMake(74,self.textLabel.frame.origin.y,self.textLabel.frame.size.width,self.textLabel.frame.size.height);
self.detailTextLabel.frame = CGRectMake(74,self.detailTextLabel.frame.origin.y+self.textLabel.frame.size.height,self.detailTextLabel.frame.size.width,self.detailTextLabel.frame.size.height);
这样detailTextLabel
将在textLabel
完成后开始......
一切顺利!!!