I know people have asked this question a bunch of times alrdy on Stack, but the usual answer of changing "Lines: 0" and selecting "Line Breaks: Word Wrap" just isn't fixing it for me.
I am using Xcode 4.2 with a Storyboard. I have placed a UILabel on a View Controller and resized it to cover most of the View. I have changed "Lines" value to 0 and "Line Breaks" value to Word Wrap.
I have tried \n
in my string: @"This is my label text \n that's supposed to wrap."
Any ideas??
EDIT: I wasn't declaring any of the label's properties in my implementation file, only on the storyboard, so I have tried the following... But with no luck ;\ (font name and size and alignment work, but number of lines and break mode seem to do nothing.)
lblText.numberOfLines = 0;
lblText.font = [UIFont fontWithName:@"Helvetica" size:(15.0)];
lblText.lineBreakMode = UILineBreakModeWordWrap;
lblText.textAlignment = UITextAlignmentLeft;
setFrame:CGRectMake
did the trick. For those who are puzzled by the numbers that followCGRectMake
, they stand for pixels: left, top, width, height. Thanks Happy! – Photosphere