Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TableViewCell overlaps text

I'm having a problem with my TableViewCell

I have two type of cell in my storyboard. when i scroll, the text overlaps in some cells. I Try everything but I do not know how else to do. thank you very much for the help

public func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
    {

        var storeNew = systemsBlog.getStore(listNews[indexPath.row].getIdStore())
        var newNotice = listNews[indexPath.row]

        let cell = tableView.dequeueReusableCellWithIdentifier("TimelineCell", forIndexPath: indexPath) as? TimelineCell

                cell!.nameLabel.text = storeNew.getName()
                cell!.postLabel?.text = newNotice.getText()
                cell!.postLabel?.numberOfLines = 0
                cell!.dateLabel.text = newNotice.getDate()
                cell!.typeImageView?.tag = indexPath.row;
                return cell!
}



class TimelineCell : UITableViewCell {

    @IBOutlet var nameLabel : UILabel!
    @IBOutlet var postLabel : UILabel?
    @IBOutlet var dateLabel : UILabel!

    override func awakeFromNib() {
     postLabel?.font = UIFont(name: "Roboto-Thin", size: 14)
    }

    override func layoutSubviews() {
        super.layoutSubviews()
    }

enter image description here

like image 269
Carolina Avatar asked Jun 15 '15 23:06

Carolina


1 Answers

I can fix the problem. In the storyboard, the label have unchacked "Clears Graphics Context". I checked and for now it solved! Thanks for the help!

like image 106
Carolina Avatar answered Nov 03 '22 07:11

Carolina