views:

124

answers:

1

Is there a way to shrink the font-size in a UITextView if there is too much text? Similar to the UILabel?

A: 

Try this:

NSInteger lengthThreshold = 200;
if( [ textView.text length ] > lengthThreshold ) {
    NSInteger newSize = ... //calculate new size based on length

    [ textView setFont: [ UIFont systemFontOfSize: newSize ]];
}
Jacob Relkin