iOS 8: UITableViewCell detail text not correctly updating

后端 未结 8 705
有刺的猬
有刺的猬 2020-12-30 02:32

tl;dr: Can I cause the detailTextLabel to have its size updated by the auto layout system in iOS on a value change?

Has anyone else had issues with the detailText l

相关标签:
8条回答
  • 2020-12-30 03:12

    I had the same problem in an iOS 8 storyboard (without Auto Layout enabled).

    I had a Table View with a static Table View Cell at the bottom of it. In IB, I added some spaces into that table cell's content area (Style: "Right Detail"). Then in code (ViewDidLoad), I updated that cell's content with...

    self.copyrightsCell.detailTextLabel.text = @"<a string>";
    

    WITHOUT the IB spaces, the cell was INVISIBLE in portrait mode.

    But WITH the initial spaces, the cell's content later appears correctly.

    Hope this helps someone.

    0 讨论(0)
  • 2020-12-30 03:15

    I have the same issue. I have am certain that the data is available and being assigned to the cell.detailTextLabel.text I have noticed that once a value has been assigned then there is no flicker if the value is changed on the return to the tableView. So it appears to me that there is only an issue on the first assignment of a value to the detailTextLabel.

    0 讨论(0)
提交回复
热议问题