PFTableViewCell在iOS上混乱

时间:2015-01-06 03:42:39

标签: ios parse-platform

我使用PFQueryTableViewController从PFObject中检索数据。这最终是成功的,但是textLabel和detailTextLabel是最重要的。图片下方是我的单元格代码。当我将这个customCell用于普通的TableView时,文本标签间隔得恰当。

enter image description here

 - (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);
    }
}

1 个答案:

答案 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完成后开始......

一切顺利!!!