tags:

views:

201

answers:

1

I have a PSTitleValueSpecifier field in my application's settings that displays a long character string.

After about 20 digits it gets cut off and I'd like to wrap the text or increase the height of the field so that any amount of characters can be displayed. Can this be accomplished? If so, how?

+1  A: 

I'm not sure if I completely understand your question, but here's what I do to achieve text wrapping in a label. You may be able to adapt some of this.

NSString *yourLongStringOfText = @"yourLongStringOfText";
UIFont *yourFont = [UIFont fontWithName:@"Helvetica" size:14.0];
CGSize constraintSize = CGSizeMake(280.0f, MAXFLOAT);
CGSize labelSize = [yourLongStringOfText sizeWithFont:yourFont
      constrainedToSize:constraintSize lineBreakMode:UILineBreakModeWordWrap];
return labelSize.height + 5;
Jonah