How would I set the Line Height/ Line Spacinh in an NSTextView? e.g How tall each line is or how much space is between each line.
+7
A:
Use the - (void)setDefaultParagraphStyle:(NSParagraphStyle *)paragraphStyle
method in your NSTextView.
Documentation on NSParagraphStyle
Documentation on NSMutableParagraphStyle
There is a setLineSpacing:
method in NSMutableParagraphStyle. There are also methods relating to line height, the methods under "Setting Other Style Information" in the NSMutableParagraphStyle documentation should prove useful.
I think that's what you're looking for. =]
Michael
2009-12-24 20:36:01
How do I change the NSParagraphStyle to NSMutableParagraphStyle so the setLineSpacing: method will work as this is what I have now (in a NSTextView subclass) http://grab.by/1ppb. And I get that warning for that problem.
Joshua
2009-12-27 18:40:56
Change the (NSParagraphStyle *) to (NSMutableParagraphStyle *)
Michael
2009-12-27 20:13:19
Thanks, I've just down that but it doesn't actually change the line spacing, any idea why?
Joshua
2009-12-28 11:42:59