This question was asked before iOS 6. I would like to post an updated answer for those who would like to do this.
This can now be done using iOS 6 and later using NSAttributedString. UITextView now accepts the attributed string as one of its properties. You can perform all kinds of manipulations with attributes with bound strings, including line spacing. You can set the minimum and maximum line heights for the line paragraph style attribute.
See the NSAttributedString Class link for more information.
Here is an example of what you could do:
NSMutableParagraphStyle *paragraph = [[NSMutableParagraphStyle alloc] init]; paragraph.minimumLineHeight = 21.0f; paragraph.maximumLineHeight = 21.0f; NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:@"Test text line 1\nTest text line 2\nTest text line 3" attributes:@{NSParagraphStyleAttributeName: paragraph}]; textView.attributedText = attributedString;
Mark suman
source share