I load the help text from plist and display it as UILabels hosted in a UIScrollView. The following is the code sequence:
UILabel *sectionDetailLabel = [[[UILabel alloc] initWithFrame:CGRectMake(34, myOriginForThisSection, 286, 20)] autorelease];
sectionDetailLabel.backgroundColor = [UIColor clearColor];
sectionDetailLabel.numberOfLines = 0;
sectionDetailLabel.font = [UIFont systemFontOfSize:12];
sectionDetailLabel.textColor = [UIColor blackColor];
sectionDetailLabel.textAlignment = UITextAlignmentLeft;
sectionDetailLabel.lineBreakMode = UILineBreakModeWordWrap;
[baseScrollView addSubview:sectionDetailLabel];
[sectionDetailLabel setText:myStringForThisSection];
[sectionDetailLabel sizeToFit];
code>
While any “long” text is wrapped correctly in several lines, I cannot manually insert any line breaks using the newline characters '\ n' in 'myStringForThisSection'. I see only the characters '\' and 'n' printed in UILabel, wherever I want a line break.
, , , , numberOfLines 0, LineBreakMode sizeToFit ( UILabel sizeWithFont:). , , , , - UILabel. , ?
. - baseScrollView, myStringForThisSection myOriginForThisSection - , .