I’m learning here as I go using TextKit on iOS (and soon for OS X). I’ve 
created an attributed name for an NSAttributedString that essentially i want 
drawn as a background rounded rect for the text in the attributed string. To do 
this I’ve subclasses NSLayoutManager and used that for UITextView. And it works 
fine in general. 

https://www.dropbox.com/s/l7j3wbnaz4r7coi/Screenshot%202014-03-23%2000.11.32.png

However the problem of course is that I’d like the bounds of the text when 
using this attribute to increase so that it looks nicer. Now I’m a bit lost. 
I’m unsure if I’m supposed to subclass other methods in NSLayoutManager to do 
this, or if I’m to do something else. I’m not totally sure what to search for 
in the docs.

My best guess is 
- (CGRect)boundingRectForGlyphRange:(NSRange)glyphRange 
inTextContainer:(NSTextContainer *)container;

but some pointers would be nice :)




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to