Note that there are some explanatory texts on larger screens.

plurals
  1. POUILabel in UITableViewCell clips content when moved in Interface Builder
    primarykey
    data
    text
    <p>I have a UILabel inside a UITableViewCell in the latest version of Xcode. I dynamically add text to it with some line breaks and it automatically adjusts which in turn adjusts my table cell height. So long as I leave the UILabel alone in Interface builder, it all works fine. IfI attempt to move it just 1 pixel to the left or right, the content gets clipped down to a single line of text and every other line that is in the line is not viewable. It's actually pretty ridiculous. I've tried every setting for the label, but if I move it any, it clips all but the first line. Does anyone have any idea of anything else to try? I know it sounds pretty ridiculous. </p> <pre><code>- (CGFloat)heightForRowInInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { CGFloat width = (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) ? kDescriptionLabelWidthPortrait : kDescriptionLabelWidthLandscape; CGFloat height = [[self descriptionString] sizeWithFont:_descriptionLabelFont constrainedToSize:CGSizeMake(width, MAXFLOAT)].height + kDescriptionLabelPadding; return MIN(MAX(height, kMinCellHeight), kMaxCellHeight); </code></pre> <p>} </p> <pre><code>#define kDescriptionLabelWidthPortrait 429.0f #define kDescriptionLabelWidthLandscape 685.0f #define kDescriptionLabelPadding 50.0f #define kDescriptionLabelFontName @"Helvetica" #define kDescriptionLabelFontSize 14.0f #define kMinCellHeight 44.0f #define kMaxCellHeight 2009.0f </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload