1

Technically, the constraints don't break but they stop working as intended. I have forked PureLayout's iOS 8 AutoLayout example to replicate this issue. In a nutshell, I have a UITableView with a custom cell that looks like this:

enter image description here

After adding

self.accessoryType = UITableViewCellAccessoryType.DisclosureIndicator

it looks like this:

enter image description here

Notice the gap between the title and the body of the cell.

https://github.com/marcus30/TableViewCellWithAutoLayoutiOS8

marcus
  • 151
  • 1
  • 8
  • 1
    That appears to me to be intended behavior. When using an accessory view the contentView of the cell is reduced by the width of the accessory view. What are you expecting, the text to sit under the accessoryView? – Mike Apr 28 '15 at 19:08
  • Yes. A constraint for the body label is set to sit under the title label, with 0 inset. – marcus Apr 28 '15 at 19:25
  • ahh I was looking at the horizontal formatting, not the vertical formatting. – Mike Apr 28 '15 at 19:26
  • I edited the question to better reflect the issue. – marcus Apr 28 '15 at 19:35
  • I don't see this behavior when I set up the cell without using pure-layout. – rdelmar Apr 28 '15 at 19:59
  • @rdelmar do you have an example? – marcus Apr 28 '15 at 20:20
  • There's not much to it. I added a label and a text view (with scrolling disabled) to a table view cell. The text view has constraints to the label, and sides and bottom of the cell, the label has one to the top of the cell. There's no code other than 2 IBOutlets in the cell class. The lines to set the estimatedRowHeight and rowHeight for the self-sizing cells were like you have, except I needed to put them in viewDidAppear to make the cell have the correct initial height. There's no need for any calls to updateConstraints or layoutIfNeeded, or anything like that. – rdelmar Apr 28 '15 at 20:56

0 Answers0