Autoresizing Issue in Xcode 8

XCode 8 - How to solve an Auto resizing issue on XCode version 8.0?

I asked to Apple about this same issue, and they have sent the following message to my inbox:

Hello Raja,

Engineering has determined that your bug report (28489404) and will be closed.

Auto resizing issue in UITableView in Xcode 6

I had the same problem recently. I added a label in my UITableViewCell's content view and every time it's hide (x >> 320). I realized that the problem was in the SOURCE CODE XML.

The XML was:

<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="InvoiceCell" rowHeight="60" id="B9T-xx-TCx" customClass="InvoiceCell"> 
// My custom cell is 60 height
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
// Wrong Autoresizing
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="B9T-xx-TCx" id="nvL-MG-mGs">
//No rect frame and wrong autoresizing mask
<autoresizingMask key="autoresizingMask"/>

To solve my problem is just change "tableViewCell" and "tableViewCellContentView" to:

<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="InvoiceCell" rowHeight="60" id="B9T-xx-TCx" customClass="InvoiceCell"> 
//Add/change this 2 lines in <tableViewCell>
<rect key="frame" x="0.0" y="0.0" width="320" height="60"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES"/>

and

<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="B9T-xx-TCx" id="nvL-MG-mGs">
//Add/change this 2 lines in <tableViewCellContentView>
<rect key="frame" x="0.0" y="0.0" width="320" height="60"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES"/>

So, problem solved! I hope this help you guys.



Related Topics



Leave a reply



Submit