Daniel Klöck
Daniel Klöck

Reputation: 21137

UITableViewCell's content resizes after reopening IB

Sometimes, when opening my storyboard in interface builder, along with the typical version change some UILables change their width and become smaller.

This may have something to do with the update to Yosemite and Xcode 6.1, since the problematic UILabels didn't use to change their size on their own.

This is the structure where the labels are included (the marked labels are the ones causing problems): enter image description here

All three have following Autoresizing properties:

enter image description here

Does someone know why this is happening, and how to make it stop??

Upvotes: 0

Views: 129

Answers (1)

Daniel Klöck
Daniel Klöck

Reputation: 21137

This was a Xcode bug.

In previous versions a table cell would be generated like this:

<tableViewCell ...>
    <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
    ...
    <tableViewCellContentView ...>
          <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>

with the new version the rect tag within the tableViewCellContentView is missing completely. After I inserted it manually, everything worked as expected.

Upvotes: 1

Related Questions